[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1393275606.11020.59.camel@joe-AO722>
Date: Mon, 24 Feb 2014 13:00:06 -0800
From: Joe Perches <joe@...ches.com>
To: Tom Rini <trini@...com>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Josh Triplett <josh@...htriplett.org>
Subject: Re: [PATCH] checkpatch.pl: Add warning for new __packed additions
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists