diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2017-09-13 04:59:05 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-09-15 08:05:11 -0400 |
commit | 5c761ce58666b3a1695697498598f8bf3484a0c7 (patch) | |
tree | 739ae6ff00509130959ca259fdc9a0cafbd4bab8 /scripts/checkpatch.pl | |
parent | e2888a7fa7f8d23396c4b25ea763fe1f38851b3d (diff) | |
download | u-boot-5c761ce58666b3a1695697498598f8bf3484a0c7.tar.gz u-boot-5c761ce58666b3a1695697498598f8bf3484a0c7.tar.bz2 u-boot-5c761ce58666b3a1695697498598f8bf3484a0c7.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.
This reintroduces the changes of
f503cc49a570 (Add warning for new __packed additions)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2287a0bca8..4142f5c837 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5616,6 +5616,13 @@ sub process { "__packed is preferred over __attribute__((packed))\n" . $herecurr); } +# Check for new packed members, warn to use care + if ($realfile !~ m@\binclude/uapi/@ && + $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 ($realfile !~ m@\binclude/uapi/@ && $line =~ /\b__attribute__\s*\(\s*\(.*aligned/) { |