From: Andy Whitcroft <apw@shadowen.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
Joel Schopp <jschopp@austin.ibm.com>, Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, Andy Whitcroft <apw@shadowen.org>
Subject: [PATCH 09/13] checkpatch: DEFINE_ macros are real definitions for exports
Date: Fri, 3 Oct 2008 16:25:50 +0100 [thread overview]
Message-ID: <1223047554-31111-10-git-send-email-apw@shadowen.org> (raw)
In-Reply-To: <1223047554-31111-1-git-send-email-apw@shadowen.org>
When we want to confirm an export is directly after its definition we need
to allow for DEFINE_ style macros. Add these to the execeptions. Refactor
the exceptions.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
scripts/checkpatch.pl | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 54dfa2b..a675f06 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1573,13 +1573,14 @@ sub process {
if (($line =~ /EXPORT_SYMBOL.*\((.*)\)/) ||
($line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
my $name = $1;
- if (($prevline !~ /^}/) &&
- ($prevline !~ /^\+}/) &&
- ($prevline !~ /^ }/) &&
- ($prevline !~ /^.DECLARE_$Ident\(\Q$name\E\)/) &&
- ($prevline !~ /^.LIST_HEAD\(\Q$name\E\)/) &&
- ($prevline !~ /^.$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(/) &&
- ($prevline !~ /\b\Q$name\E(?:\s+$Attribute)?\s*(?:;|=|\[)/)) {
+ if ($prevline !~ /(?:
+ ^.}|
+ ^.DEFINE_$Ident\(\Q$name\E\)|
+ ^.DECLARE_$Ident\(\Q$name\E\)|
+ ^.LIST_HEAD\(\Q$name\E\)|
+ ^.$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(|
+ \b\Q$name\E(?:\s+$Attribute)?\s*(?:;|=|\[)
+ )/x) {
WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr);
}
}
--
1.6.0.1.451.gc8d31
next prev parent reply other threads:[~2008-10-03 15:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-03 15:25 [PATCH 00/13] checkpatch: update to version 0.24 Andy Whitcroft
2008-10-03 15:25 ` [PATCH 01/13] checkpatch: do is not a possible type Andy Whitcroft
2008-10-03 15:25 ` [PATCH 02/13] checkpatch: labels are not possible types Andy Whitcroft
2008-10-03 15:25 ` [PATCH 03/13] checkpatch: handle do without braces if we have enough context Andy Whitcroft
2008-10-03 15:25 ` [PATCH 04/13] checkpatch: macros which define structure members are not complex Andy Whitcroft
2008-10-03 15:25 ` [PATCH 05/13] checkpatch: accept any sized le/be type Andy Whitcroft
2008-10-03 15:25 ` [PATCH 06/13] checkpatch: pull out known acceptable typedefs Andy Whitcroft
2008-10-03 15:25 ` [PATCH 07/13] checkpatch: suspect code indent must stop at #else/#elif Andy Whitcroft
2008-10-03 15:25 ` [PATCH 08/13] checkpatch: complex macros checks miss square brackets Andy Whitcroft
2008-10-03 15:25 ` Andy Whitcroft [this message]
2008-10-03 15:25 ` [PATCH 10/13] checkpatch: trailing statements ensure we report the end of the line Andy Whitcroft
2008-10-03 15:25 ` [PATCH 11/13] checkpatch: suspect indent handle macro continuation Andy Whitcroft
2008-10-03 15:25 ` [PATCH 12/13] checkpatch: allow for comments either side of a brace on case Andy Whitcroft
2008-10-03 15:25 ` [PATCH 13/13] checkpatch: version: 0.24 Andy Whitcroft
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=1223047554-31111-10-git-send-email-apw@shadowen.org \
--to=apw@shadowen.org \
--cc=akpm@osdl.org \
--cc=jschopp@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rdunlap@xenotime.net \
/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®