From: Joe Perches <joe@perches.com>
To: David Howells <dhowells@redhat.com>
Cc: akpm@linux-foundation.org, hannes@stressinduktion.org,
linux-kernel@vger.kernel.org, dwmw2@infradead.org
Subject: [PATCH] checkpatch: Make extern in .h prototypes quieter.
Date: Mon, 02 Sep 2013 09:21:44 -0700 [thread overview]
Message-ID: <1378138904.1953.72.camel@joe-AO722> (raw)
In-Reply-To: <9606.1378129893@warthog.procyon.org.uk>
The use of extern in .h files is a bit contentious.
Make it emitted only when --strict is used on the
command-line.
Signed-off-by: Joe Perches <joe@perches.com>
---
scripts/checkpatch.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9bb056c..13165ea 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3927,8 +3927,8 @@ sub process {
# 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\s+(.*)/$1$2/;
}
next prev parent reply other threads:[~2013-09-02 16:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-02 13:51 Please discard "checkpatch: warn when using extern with function prototypes in .h files" David Howells
2013-09-02 16:21 ` Joe Perches [this message]
2013-09-02 20:51 ` [PATCH] checkpatch: Make extern in .h prototypes quieter Geert Uytterhoeven
2013-09-02 20:58 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378138904.1953.72.camel@joe-AO722 \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dwmw2@infradead.org \
--cc=hannes@stressinduktion.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®