Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1d85780 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

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: default avatarJoe Perches <joe@perches.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 58f09e00
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3975,7 +3975,7 @@ 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",
			if (CHK("AVOID_EXTERNS",
				"extern prototypes should be avoided in .h files\n" . $herecurr) &&
			    $fix) {
				$fixed[$linenr - 1] =~ s/(.*)\bextern\b\s*(.*)/$1$2/;