mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
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 <[email protected]> Cc: David Howells <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
58f09e00ae
commit
d1d85780dd
1 file changed
+2
-2
@@ -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/;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user