diff options
author | Joe Perches <joe@perches.com> | 2013-09-24 18:27:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-24 20:00:26 -0400 |
commit | d1d85780dd30e137d8ff505c1c2e79eaf729853d (patch) | |
tree | 5688d52d88f6a97b7b8ae26afa1f58ac10dd9347 /scripts | |
parent | 58f09e00ae095e46ef9edfcf3a5fd9ccdfad065e (diff) |
checkpatch: make extern in .h prototypes quieter
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 <joe@perches.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 47016c304c84..66cad506b8a2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -3975,8 +3975,8 @@ sub string_find_replace { | |||
3975 | # check for new externs in .h files. | 3975 | # check for new externs in .h files. |
3976 | if ($realfile =~ /\.h$/ && | 3976 | if ($realfile =~ /\.h$/ && |
3977 | $line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) { | 3977 | $line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) { |
3978 | if (WARN("AVOID_EXTERNS", | 3978 | if (CHK("AVOID_EXTERNS", |
3979 | "extern prototypes should be avoided in .h files\n" . $herecurr) && | 3979 | "extern prototypes should be avoided in .h files\n" . $herecurr) && |
3980 | $fix) { | 3980 | $fix) { |
3981 | $fixed[$linenr - 1] =~ s/(.*)\bextern\b\s*(.*)/$1$2/; | 3981 | $fixed[$linenr - 1] =~ s/(.*)\bextern\b\s*(.*)/$1$2/; |
3982 | } | 3982 | } |