[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b8758249e142da8c2db9920e4cf71596ff7f9570.camel@perches.com>
Date: Fri, 25 Jun 2021 21:31:42 -0700
From: Joe Perches <joe@...ches.com>
To: Jim Cromie <jim.cromie@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] checkpatch: tweak extern in C warning
On Fri, 2021-06-25 at 21:40 -0600, Jim Cromie wrote:
> The extern-in-C rule has one important exception: the symbol is
> defined in/by the linker script. By convention, these almost always
> contain: _start, _stop, _end. Suppress the warning on such symbols.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> @@ -6910,7 +6910,8 @@ sub process {
> $stat =~ /^.\s*extern\s+/)
> {
> WARN("AVOID_EXTERNS",
> - "externs should be avoided in .c files\n" . $herecurr);
> + "externs should be avoided in .c files\n($stat)\n" . $herecurr)
> + unless $stat =~ /_start|_stop|_end/;
nak.
As far as I can tell, there's no reason these symbols
should not be in .h files.
besides that:
output is single line, $stat should not be used and
using unless is not desired.
Powered by blists - more mailing lists