diff options
author | Andy Whitcroft <apw@shadowen.org> | 2008-10-15 22:02:34 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 11:21:37 -0700 |
commit | 480120586464e5a8cd2289a90ffbb5c042e66ba0 (patch) | |
tree | 27485bdf461c4cf6323e5eec5a9ee55b8b90c8fc | |
parent | bf30d6ede099c2a31b13bbd05b1022dc0da684d5 (diff) | |
download | kernel_samsung_smdk4412-480120586464e5a8cd2289a90ffbb5c042e66ba0.zip kernel_samsung_smdk4412-480120586464e5a8cd2289a90ffbb5c042e66ba0.tar.gz kernel_samsung_smdk4412-480120586464e5a8cd2289a90ffbb5c042e66ba0.tar.bz2 |
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>
-rwxr-xr-x | 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); } } |