diff options
author | Andy Whitcroft <apw@canonical.com> | 2012-01-10 18:10:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 19:30:50 -0500 |
commit | 87a53877185627b49a903023255425bda78f890c (patch) | |
tree | 47809b22567658e1e17be1603358d06f79a8e99f /scripts/checkpatch.pl | |
parent | a13858033a3a993147d190317cc9d709f0a1b819 (diff) |
checkpatch: fix EXPORT_SYMBOL handling following a function
The following fragment defeats the DEVICE_ATTR style handing, check for
and ignore the close brace '}' in this context:
int foo()
{
}
DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
ata_scsi_lpm_show, ata_scsi_lpm_put);
EXPORT_SYMBOL_GPL(dev_attr_link_power_management_policy);
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
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 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d8ac16ab5e61..afc656d00589 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2131,7 +2131,7 @@ sub process { | |||
2131 | # XXX(foo); | 2131 | # XXX(foo); |
2132 | # EXPORT_SYMBOL(something_foo); | 2132 | # EXPORT_SYMBOL(something_foo); |
2133 | my $name = $1; | 2133 | my $name = $1; |
2134 | if ($stat =~ /^.([A-Z_]+)\s*\(\s*($Ident)/ && | 2134 | if ($stat =~ /^(?:.\s*}\s*\n)?.([A-Z_]+)\s*\(\s*($Ident)/ && |
2135 | $name =~ /^${Ident}_$2/) { | 2135 | $name =~ /^${Ident}_$2/) { |
2136 | #print "FOO C name<$name>\n"; | 2136 | #print "FOO C name<$name>\n"; |
2137 | $suppress_export{$realline_next} = 1; | 2137 | $suppress_export{$realline_next} = 1; |