summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-02-25 10:27:00 -0500
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-02-26 21:19:29 +0100
commitf503cc49a570b1e28a93b75bc912aedc93ba2cd0 (patch)
tree1cf85e8402c29913886d9dba4377ed2208bb6392 /scripts
parentb60eff31f3bd71a6f14b6c6efc8ad5fb3705de6d (diff)
downloadblackbird-obmc-uboot-f503cc49a570b1e28a93b75bc912aedc93ba2cd0.tar.gz
blackbird-obmc-uboot-f503cc49a570b1e28a93b75bc912aedc93ba2cd0.zip
checkpatch.pl: Add warning for new __packed additions
While there are valid reasons to use __packed, often the answer is that you should be doing something else here instead. Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 88c5bc7735..df0820c1a1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3331,6 +3331,11 @@ sub process {
WARN("PREFER_PACKED",
"__packed is preferred over __attribute__((packed))\n" . $herecurr);
}
+# Check for new packed members, warn to use care
+ if ($line =~ /\b(__attribute__\s*\(\s*\(.*\bpacked|__packed)\b/) {
+ WARN("NEW_PACKED",
+ "Adding new packed members is to be done with care\n" . $herecurr);
+ }
# Check for __attribute__ aligned, prefer __aligned
if ($line =~ /\b__attribute__\s*\(\s*\(.*aligned/) {
OpenPOWER on IntegriCloud