From: Joe Perches Date: Thu, 13 Jan 2011 01:00:00 +0000 (-0800) Subject: checkpatch.pl: add "prefer __packed" check X-Git-Tag: v2.6.38-rc1~351 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d130fd03e06672f7700e2cb694b29f9a98227ca;p=platform%2Fkernel%2Flinux-3.10.git checkpatch.pl: add "prefer __packed" check There's a __packed #define for __attribute__((packed)). Add a checkpatch to tell people about it. Signed-off-by: Joe Perches Cc: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index fd9560e..4c0383d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2743,6 +2743,11 @@ sub process { WARN("plain inline is preferred over $1\n" . $herecurr); } +# Check for __attribute__ packed, prefer __packed + if ($line =~ /\b__attribute__\s*\(\s*\(.*\bpacked\b/) { + WARN("__packed is preferred over __attribute__((packed))\n" . $herecurr); + } + # check for sizeof(&) if ($line =~ /\bsizeof\s*\(\s*\&/) { WARN("sizeof(& should be avoided\n" . $herecurr);