diff options
author | Patrick Pannuto <ppannuto@codeaurora.org> | 2010-08-09 20:21:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-09 23:45:09 -0400 |
commit | b998e001e6ce6540ea04a264debc50ae44d2db7a (patch) | |
tree | 6a265af53f8317691ed5bd39b30f55f0df0f9c1a /scripts/checkpatch.pl | |
parent | 09ef87255da0e005dd0ab39ca25714208cf29cb3 (diff) |
checkpatch: fix extraneous EXPORT_SYMBOL* warnings
These are caused by checkpatch incorrectly parsing its internal
representation of a statement block for struct's (or anything else that is
a statement block encapsulated in {}'s that also ends with a ';'). Fix
this by properly parsing a statement block.
An example:
+struct dummy_type dummy = {
+ .foo = "baz",
+};
+EXPORT_SYMBOL_GPL(dummy);
+
+static int dummy_func(void)
+{
+ return -EDUMMYCODE;
+}
+EXPORT_SYMBOL_GPL(dummy_func);
WARNING: EXPORT_SYMBOL(foo); should immediately \
follow its function/variable
#19: FILE: dummy.c:4:
+EXPORT_SYMBOL_GPL(dummy);
The above warning is issued when it should not be.
Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
Cc: 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-x | scripts/checkpatch.pl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dd11bbe01338..2039acdf5122 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -558,6 +558,9 @@ sub ctx_statement_block { | |||
558 | $type = ($level != 0)? '{' : ''; | 558 | $type = ($level != 0)? '{' : ''; |
559 | 559 | ||
560 | if ($level == 0) { | 560 | if ($level == 0) { |
561 | if (substr($blk, $off + 1, 1) eq ';') { | ||
562 | $off++; | ||
563 | } | ||
561 | last; | 564 | last; |
562 | } | 565 | } |
563 | } | 566 | } |