lkml.org 
[lkml]   [2014]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] checkpatch.pl: Add warning for new __packed additions
On Mon, Feb 24, 2014 at 03:38:16PM -0500, Tom Rini wrote:
> 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);
> + }

This seems wrong; "is to be done with care" is the very definition of a
false positive. At *best* this should always be CHK, and even then it
seems excessive.

- Josh Triplett


\
 
 \ /
  Last update: 2014-02-24 23:21    [W:1.441 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site