There are some rare cases which need external declarations in .c files. patchew.org and checkpatch.pl will complain errors on patches for these declarations.
Degrade ERROR to WARN to erase the error complaints taking checkpatch.pl in kernel as reference. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3c0a28e..9123788 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2546,7 +2546,7 @@ sub process { if ($s =~ /^\s*;/ && $function_name ne 'uninitialized_var') { - ERROR("externs should be avoided in .c files\n" . $herecurr); + WARN("externs should be avoided in .c files\n" . $herecurr); } if ($paren_space =~ /\n/) { @@ -2556,7 +2556,7 @@ sub process { } elsif ($realfile =~ /\.c$/ && defined $stat && $stat =~ /^.\s*extern\s+/) { - ERROR("externs should be avoided in .c files\n" . $herecurr); + WARN("externs should be avoided in .c files\n" . $herecurr); } # check for pointless casting of g_malloc return -- 2.9.5