Commit f503cc49a570b1e28a93b75bc912aedc93ba2cd0

Authored by Tom Rini
Committed by Albert ARIBAUD
1 parent b60eff31f3

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>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

scripts/checkpatch.pl
... ... @@ -3331,6 +3331,11 @@
3331 3331 WARN("PREFER_PACKED",
3332 3332 "__packed is preferred over __attribute__((packed))\n" . $herecurr);
3333 3333 }
  3334 +# Check for new packed members, warn to use care
  3335 + if ($line =~ /\b(__attribute__\s*\(\s*\(.*\bpacked|__packed)\b/) {
  3336 + WARN("NEW_PACKED",
  3337 + "Adding new packed members is to be done with care\n" . $herecurr);
  3338 + }
3334 3339  
3335 3340 # Check for __attribute__ aligned, prefer __aligned
3336 3341 if ($line =~ /\b__attribute__\s*\(\s*\(.*aligned/) {