Re: [PATCH 7/9] docs: kdoc: remove some ineffective code

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

 



Em Fri,  6 Jun 2025 10:34:36 -0600
Jonathan Corbet <corbet@xxxxxxx> escreveu:

> The code testing for a pointer declaration in process_name() has no actual
> effect on subsequent actions; remove it.
> 
> Signed-off-by: Jonathan Corbet <corbet@xxxxxxx>
> ---
>  scripts/lib/kdoc/kdoc_parser.py | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
> index 7c635000f3de..4e1ab28ff7cc 100644
> --- a/scripts/lib/kdoc/kdoc_parser.py
> +++ b/scripts/lib/kdoc/kdoc_parser.py
> @@ -1229,11 +1229,6 @@ class KernelDoc:
>              parenthesis = r"(?:\(\w*\))?"   # optional parenthesis on function
>              decl_end = r"(?:[-:].*)"         # end of the name part
>  
> -            # test for pointer declaration type, foo * bar() - desc
> -            r = KernRe(fr"^{decl_start}([\w\s]+?){parenthesis}?\s*{decl_end}?$")
> -            if r.search(line):
> -                self.entry.identifier = r.group(1)
> -

I'm almost sure this was added at the Perl version to catch some corner
case. If this not need anymore, better to strip ;-)

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

>              # Test for data declaration
>              r = KernRe(r"^\s*\*?\s*(struct|union|enum|typedef)\b\s*(\w*)")
>              r2 = KernRe(fr"^{decl_start}{fn_type}(?:define\s+)?(\w+)\s*{parenthesis}\s*{decl_end}?$")



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