Re: [PATCH] kernel-doc: Fix symbol matching for dropped suffixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Fri,  6 Jun 2025 15:15:42 +0100
"Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> escreveu:

> The support for dropping "_noprof" missed dropping the suffix from
> exported symbols.  That meant that using the :export: feature would
> look for kernel-doc for (eg) krealloc_noprof() and not find the
> kernel-doc for krealloc().
> 
> Fixes: 51a7bf0238c2 (scripts/kernel-doc: drop "_noprof" on function prototypes)
> Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
> ---
>  scripts/lib/kdoc/kdoc_parser.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
> index 062453eefc7a..2c6143f7ca0f 100644
> --- a/scripts/lib/kdoc/kdoc_parser.py
> +++ b/scripts/lib/kdoc/kdoc_parser.py
> @@ -1171,16 +1171,24 @@ class KernelDoc:
>          with a staticmethod decorator.
>          """
>  
> +        # We support documenting some exported symbols with different
> +        # names.  A horrible hack.
> +        suffixes = [ '_noprof' ]
> +
>          # Note: it accepts only one EXPORT_SYMBOL* per line, as having
>          # multiple export lines would violate Kernel coding style.
>  
>          if export_symbol.search(line):
>              symbol = export_symbol.group(2)
> +            for suffix in suffixes:
> +                symbol = symbol.removesuffix(suffix)
>              function_set.add(symbol)
>              return
>  
>          if export_symbol_ns.search(line):
>              symbol = export_symbol_ns.group(2)
> +            for suffix in suffixes:
> +                symbol = symbol.removesuffix(suffix)
>              function_set.add(symbol)

For now, this sounds ok to me.

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>

>  
>      def process_normal(self, ln, line):



Thanks,
Mauro




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux