lkml.org 
[lkml]   [2017]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] scripts/checkpatch.pl: fix false warning of externs checking.
Date
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
\
 
 \ /
  Last update: 2017-10-10 10:46    [W:0.035 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site