Skip to content

Commit 87a5387

Browse files
Andy Whitcrofttorvalds
authored andcommitted
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>
1 parent a138580 commit 87a5387

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/checkpatch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2131,7 +2131,7 @@ sub process {
21312131
# XXX(foo);
21322132
# EXPORT_SYMBOL(something_foo);
21332133
my $name = $1;
2134-
if ($stat =~ /^.([A-Z_]+)\s*\(\s*($Ident)/ &&
2134+
if ($stat =~ /^(?:.\s*}\s*\n)?.([A-Z_]+)\s*\(\s*($Ident)/ &&
21352135
$name =~ /^${Ident}_$2/) {
21362136
#print "FOO C name<$name>\n";
21372137
$suppress_export{$realline_next} = 1;

0 commit comments

Comments
 (0)