History

checkpatch: add a "prefer __aligned" check

Prefer the use of __aligned(size) over __attribute__((__aligned___(size))) Link: http://lkml.kernel.org/r/20110609094526.1571774c.akpm@linux-foundation.org

Joe Perches committed 15 years ago

Commit 39b7e281 parent 20112471 file · +5 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+5−0
@@ -2891,6 +2891,11 @@ sub process { · 2890 unmodified lines
28912891 WARN("__packed is preferred over __attribute__((packed))\n" . $herecurr);
28922892 }
28932893
2894+# Check for __attribute__ aligned, prefer __aligned
2895+ if ($line =~ /\b__attribute__\s*\(\s*\(.*aligned/) {
2896+ WARN("__aligned(size) is preferred over __attribute__((aligned(size)))\n" . $herecurr);
2897+ }
2898+
28942899 # check for sizeof(&)
28952900 if ($line =~ /\bsizeof\s*\(\s*\&/) {
28962901 WARN("sizeof(& should be avoided\n" . $herecurr);