Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752539AbaBXVbf (ORCPT ); Mon, 24 Feb 2014 16:31:35 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54244 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbaBXVbe (ORCPT ); Mon, 24 Feb 2014 16:31:34 -0500 Date: Mon, 24 Feb 2014 13:31:28 -0800 From: josh@joshtriplett.org To: Tom Rini Cc: linux-kernel@vger.kernel.org, Andrew Morton , Joe Perches Subject: Re: [PATCH] checkpatch.pl: Add warning for new __packed additions Message-ID: <20140224213128.GB12233@cloud> References: <1393274296-26179-1-git-send-email-trini@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1393274296-26179-1-git-send-email-trini@ti.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Joe Perches > Cc: Josh Triplett > Signed-off-by: Tom Rini > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/