aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@shadowen.org>2008-10-16 01:02:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:37 -0400
commit480120586464e5a8cd2289a90ffbb5c042e66ba0 (patch)
tree27485bdf461c4cf6323e5eec5a9ee55b8b90c8fc /scripts/checkpatch.pl
parentbf30d6ede099c2a31b13bbd05b1022dc0da684d5 (diff)
checkpatch: DEFINE_ macros are real definitions for exports
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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 54dfa2b543dd..a675f067b572 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1573,13 +1573,14 @@ sub process {
1573 if (($line =~ /EXPORT_SYMBOL.*\((.*)\)/) || 1573 if (($line =~ /EXPORT_SYMBOL.*\((.*)\)/) ||
1574 ($line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { 1574 ($line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
1575 my $name = $1; 1575 my $name = $1;
1576 if (($prevline !~ /^}/) && 1576 if ($prevline !~ /(?:
1577 ($prevline !~ /^\+}/) && 1577 ^.}|
1578 ($prevline !~ /^ }/) && 1578 ^.DEFINE_$Ident\(\Q$name\E\)|
1579 ($prevline !~ /^.DECLARE_$Ident\(\Q$name\E\)/) && 1579 ^.DECLARE_$Ident\(\Q$name\E\)|
1580 ($prevline !~ /^.LIST_HEAD\(\Q$name\E\)/) && 1580 ^.LIST_HEAD\(\Q$name\E\)|
1581 ($prevline !~ /^.$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(/) && 1581 ^.$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(|
1582 ($prevline !~ /\b\Q$name\E(?:\s+$Attribute)?\s*(?:;|=|\[)/)) { 1582 \b\Q$name\E(?:\s+$Attribute)?\s*(?:;|=|\[)
1583 )/x) {
1583 WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); 1584 WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr);
1584 } 1585 }
1585 } 1586 }