All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch.pl: Add warning for new __packed additions
@ 2014-02-24 20:38 Tom Rini
  2014-02-24 21:00 ` Joe Perches
  2014-02-24 21:31 ` josh
  0 siblings, 2 replies; 17+ messages in thread
From: Tom Rini @ 2014-02-24 20:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Joe Perches, Josh Triplett

While there are valid reasons to use __packed, often the answer is that
you should be doing something else here instead.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Tom Rini <trini@ti.com>
---
 scripts/checkpatch.pl |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0ea2a1e..fef3b13 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4010,6 +4010,11 @@ sub process {
 			WARN("PREFER_PACKED",
 			     "__packed is preferred over __attribute__((packed))\n" . $herecurr);
 		}
+# Check for new packed usage, 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 ($realfile !~ m@\binclude/uapi/@ &&
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-02-27 20:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-24 20:38 [PATCH] checkpatch.pl: Add warning for new __packed additions Tom Rini
2014-02-24 21:00 ` Joe Perches
2014-02-24 21:11   ` Tom Rini
2014-02-24 21:28     ` Joe Perches
2014-02-24 21:52       ` Tom Rini
2014-02-24 22:02         ` Joe Perches
2014-02-24 22:04           ` Tom Rini
2014-02-24 22:08             ` Joe Perches
2014-02-24 22:20               ` Tom Rini
2014-02-24 22:31                 ` Joe Perches
2014-02-24 22:43                   ` Tom Rini
2014-02-25  5:23                     ` Joe Perches
2014-02-25 12:30                       ` Tom Rini
2014-02-26 22:04                         ` Joe Perches
2014-02-27 20:33                           ` Tom Rini
2014-02-25  8:56             ` Heiko Carstens
2014-02-24 21:31 ` josh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.