Skip to content

Commit f503cc4

Browse files
trinialbert-aribaud-u-boot
authored andcommitted
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>
1 parent b60eff3 commit f503cc4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/checkpatch.pl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,6 +3331,11 @@ sub process {
33313331
WARN("PREFER_PACKED",
33323332
"__packed is preferred over __attribute__((packed))\n" . $herecurr);
33333333
}
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+
}
33343339

33353340
# Check for __attribute__ aligned, prefer __aligned
33363341
if ($line =~ /\b__attribute__\s*\(\s*\(.*aligned/) {

0 commit comments

Comments
 (0)