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
2891 WARN("__packed is preferred over __attribute__((packed))\n" . $herecurr);2891 WARN("__packed is preferred over __attribute__((packed))\n" . $herecurr);
2892 }2892 }
2893 2893
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
2894# check for sizeof(&)2899# check for sizeof(&)
2895 if ($line =~ /\bsizeof\s*\(\s*\&/) {2900 if ($line =~ /\bsizeof\s*\(\s*\&/) {
2896 WARN("sizeof(& should be avoided\n" . $herecurr);2901 WARN("sizeof(& should be avoided\n" . $herecurr);