mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Tom Rini <trini@ti.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Josh Triplett <josh@joshtriplett.org>
Subject: Re: [PATCH] checkpatch.pl: Add warning for new __packed additions
Date: Mon, 24 Feb 2014 13:00:06 -0800	[thread overview]
Message-ID: <1393275606.11020.59.camel@joe-AO722> (raw)
In-Reply-To: <1393274296-26179-1-git-send-email-trini@ti.com>

On Mon, 2014-02-24 at 15:38 -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.
[]
> diff --git 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);
> +		}

Hi Tom.

This might be too noisy as it will warn on any use of __packed,
including existing ones if checking using -f/--file.

(there are some odd, probably broken ones in drivers/char/tpm/tpm_acpi.c)

How often is this actually a problem?

It'll warn on any use of packed not just packed members.

This may be better as
	"Using 'packed' can impact performance\n"
and only tested when not in --file mode.




  reply	other threads:[~2014-02-24 21:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24 20:38 Tom Rini
2014-02-24 21:00 ` Joe Perches [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393275606.11020.59.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trini@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®