From: Joe Perches <joe@perches.com>
To: Jiang Biao <jiang.biao2@zte.com.cn>, apw@canonical.com
Cc: linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn
Subject: Re: [PATCH] scripts/checkpatch.pl: fix false warning of externs checking.
Date: Tue, 10 Oct 2017 01:54:42 -0700 [thread overview]
Message-ID: <1507625682.3552.30.camel@perches.com> (raw)
In-Reply-To: <1507624970-4609-1-git-send-email-jiang.biao2@zte.com.cn>
On Tue, 2017-10-10 at 16:42 +0800, Jiang Biao wrote:
> When adding a function declaration in a .c file without an extern
> keywork decoration, checkpatch.pl will complain *externs should be
> avoided in .c files* false warning. This patch fix the bug.
nack.
The point is that external function declarations should be
done via #include.
> Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
> ---
> scripts/checkpatch.pl | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index dd2c262..170daf1 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5927,7 +5927,7 @@ sub process {
>
> # check for new externs in .c files.
> if ($realfile =~ /\.c$/ && defined $stat &&
> - $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)
> + $stat =~ /^.\s*(?:extern\s+)$Type\s+($Ident)(\s*)\(/s)
> {
> my $function_name = $1;
> my $paren_space = $2;
prev parent reply other threads:[~2017-10-10 8:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-10 8:42 [PATCH] scripts/checkpatch.pl: fix false warning of externs checking Jiang Biao
2017-10-10 8:54 ` Joe Perches [this message]
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=1507625682.3552.30.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=jiang.biao2@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=zhong.weidong@zte.com.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.