From: Jiang Biao <jiang.biao2@zte.com.cn>
To: apw@canonical.com, joe@perches.com
Cc: linux-kernel@vger.kernel.org, jiang.biao2@zte.com.cn,
zhong.weidong@zte.com.cn
Subject: [PATCH] scripts/checkpatch.pl: fix false warning of externs checking.
Date: Tue, 10 Oct 2017 16:42:50 +0800 [thread overview]
Message-ID: <1507624970-4609-1-git-send-email-jiang.biao2@zte.com.cn> (raw)
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.
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;
--
2.7.4
next reply other threads:[~2017-10-10 8:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-10 8:42 Jiang Biao [this message]
2017-10-10 8:54 ` Joe Perches
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=1507624970-4609-1-git-send-email-jiang.biao2@zte.com.cn \
--to=jiang.biao2@zte.com.cn \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--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 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®