lkml.org 
[lkml]   [2011]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 06/11] checkpatch: fix EXPORT_SYMBOL handling following a function
    Date
    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>
    ---
    scripts/checkpatch.pl | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
    index ca70bbf..1ebfd17 100755
    --- a/scripts/checkpatch.pl
    +++ b/scripts/checkpatch.pl
    @@ -2127,7 +2127,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;
    --
    1.7.5.4


    \
     
     \ /
      Last update: 2011-11-28 16:45    [W:0.018 / U:29.964 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site