projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58f09e0
)
checkpatch: make extern in .h prototypes quieter
author
Joe Perches
<
[email protected]
>
Tue, 24 Sep 2013 22:27:46 +0000
(15:27 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 25 Sep 2013 00:00:26 +0000
(17:00 -0700)
The use of extern in .h files is a bit contentious.
Make the warning be emitted only when --strict is used on the command
line.
Signed-off-by: Joe Perches <
[email protected]
>
Cc: David Howells <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
scripts/checkpatch.pl
patch
|
blob
|
history
diff --git
a/scripts/checkpatch.pl
b/scripts/checkpatch.pl
index 47016c304c847efffb96da5358224a9b5a93cc5e..66cad506b8a2a944f2873856ef0078445f673b8b 100755
(executable)
--- a/
scripts/checkpatch.pl
+++ b/
scripts/checkpatch.pl
@@
-3975,8
+3975,8
@@
sub string_find_replace {
# check for new externs in .h files.
if ($realfile =~ /\.h$/ &&
$line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) {
- if (
WARN
("AVOID_EXTERNS",
-
"extern prototypes should be avoided in .h files\n" . $herecurr) &&
+ if (
CHK
("AVOID_EXTERNS",
+ "extern prototypes should be avoided in .h files\n" . $herecurr) &&
$fix) {
$fixed[$linenr - 1] =~ s/(.*)\bextern\b\s*(.*)/$1$2/;
}