projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88f8831
)
checkpatch.pl: add "prefer __packed" check
author
Joe Perches
<
[email protected]
>
Thu, 13 Jan 2011 01:00:00 +0000
(17:00 -0800)
committer
Linus Torvalds
<
[email protected]
>
Thu, 13 Jan 2011 16:03:11 +0000
(08:03 -0800)
There's a __packed #define for __attribute__((packed)). Add a checkpatch
to tell people about it.
Signed-off-by: Joe Perches <
[email protected]
>
Cc: Andy Whitcroft <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
scripts/checkpatch.pl
patch
|
blob
|
history
diff --git
a/scripts/checkpatch.pl
b/scripts/checkpatch.pl
index fd9560ea976cdea913340315cc9bf9b098962643..4c0383da1c9a22087853e423875b7829f03f87ac 100755
(executable)
--- 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);