From: Joe Perches Date: Tue, 26 Jul 2011 00:13:24 +0000 (-0700) Subject: checkpatch: add a "prefer __aligned" check X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=39b7e2878e783af027ddd3530f7a0abec330905d;p=mv-sheeva.git 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 Suggested-by: Andrew Morton Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b14f830cb0f..8f35f0e0351 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2891,6 +2891,11 @@ sub process { WARN("__packed is preferred over __attribute__((packed))\n" . $herecurr); } +# Check for __attribute__ aligned, prefer __aligned + if ($line =~ /\b__attribute__\s*\(\s*\(.*aligned/) { + WARN("__aligned(size) is preferred over __attribute__((aligned(size)))\n" . $herecurr); + } + # check for sizeof(&) if ($line =~ /\bsizeof\s*\(\s*\&/) { WARN("sizeof(& should be avoided\n" . $herecurr);