lkml.org 
[lkml]   [2021]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: False positive EXPORT_SYMBOL warning with NS variants
From
Date
On 9/5/21 12:51 AM, Joe Perches wrote:
> On Fri, 2021-09-03 at 11:01 -0500, Ian Pilcher wrote:
>> $ cat foo.c
>> // SPDX-License-Identifier: GPL-2.0-only
>> void (*foo)(void);
>> EXPORT_SYMBOL_NS(foo, FOO);
>>
>> $ scripts/checkpatch.pl -f foo.c
>> WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
>> #3: FILE: foo.c:3:
>> +EXPORT_SYMBOL_NS(foo, FOO);
>>
>> The non-NS EXPORT_SYMBOL variants don't trigger this warning.
>>
>
> Try this:
> ---
> scripts/checkpatch.pl | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 88cb294dc4472..91798b07c6cb5 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -4449,6 +4449,7 @@ sub process {
> # XXX(foo);
> # EXPORT_SYMBOL(something_foo);
> my $name = $1;
> + $name =~ s/^\s*($Ident).*/$1/;
> if ($stat =~ /^(?:.\s*}\s*\n)?.([A-Z_]+)\s*\(\s*($Ident)/ &&
> $name =~ /^${Ident}_$2/) {
> #print "FOO C name<$name>\n";
>

Seems to work

--
========================================================================
In Soviet Russia, Google searches you!
========================================================================

\
 
 \ /
  Last update: 2021-09-09 17:01    [W:0.074 / U:1.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site