From: Andy Whitcroft Date: Thu, 8 Dec 2011 04:42:23 +0000 (+1100) Subject: checkpatch: fix EXPORT_SYMBOL handling following a function X-Git-Tag: next-20111212~1^2~103 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=31f945b8e48e0bb152459a1926eec7aacac5d8cb;p=karo-tx-linux.git 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 Cc: Joe Perches Signed-off-by: Andrew Morton --- 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 { # XXX(foo); # EXPORT_SYMBOL(something_foo); my $name = $1; - if ($stat =~ /^.([A-Z_]+)\s*\(\s*($Ident)/ && + if ($stat =~ /^(?:.\s*}\s*\n)?.([A-Z_]+)\s*\(\s*($Ident)/ && $name =~ /^${Ident}_$2/) { #print "FOO C name<$name>\n"; $suppress_export{$realline_next} = 1;