lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250710081245.516339b0@foz.lan>
Date: Thu, 10 Jul 2025 08:12:45 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Jonathan Corbet <corbet@....net>
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, Akira Yokosawa
 <akiyks@...il.com>
Subject: Re: [PATCH 06/12] docs: kdoc: use self.entry.parameterlist directly
 in check_sections()

Em Wed,  2 Jul 2025 16:35:18 -0600
Jonathan Corbet <corbet@....net> escreveu:

> Callers of check_sections() join parameterlist into a single string, which
> is then immediately split back into the original list.  Rather than do all
> that, just use parameterlist directly in check_sections().
> 
> Signed-off-by: Jonathan Corbet <corbet@....net>

LGTM.
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>

> ---
>  scripts/lib/kdoc/kdoc_parser.py | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
> index b28f056365cb..ffd49f9395ae 100644
> --- a/scripts/lib/kdoc/kdoc_parser.py
> +++ b/scripts/lib/kdoc/kdoc_parser.py
> @@ -476,19 +476,18 @@ class KernelDoc:
>                          self.push_parameter(ln, decl_type, param, dtype,
>                                              arg, declaration_name)
>  
> -    def check_sections(self, ln, decl_name, decl_type, sectcheck, prmscheck):
> +    def check_sections(self, ln, decl_name, decl_type, sectcheck):
>          """
>          Check for errors inside sections, emitting warnings if not found
>          parameters are described.
>          """
>  
>          sects = sectcheck.split()
> -        prms = prmscheck.split()
>  
>          for sx in range(len(sects)):                  # pylint: disable=C0200
>              err = True
> -            for px in range(len(prms)):               # pylint: disable=C0200
> -                if prms[px] == sects[sx]:
> +            for param in self.entry.parameterlist:
> +                if param == sects[sx]:
>                      err = False
>                      break
>  
> @@ -753,8 +752,7 @@ class KernelDoc:
>  
>          self.create_parameter_list(ln, decl_type, members, ';',
>                                     declaration_name)
> -        self.check_sections(ln, declaration_name, decl_type,
> -                            self.entry.sectcheck, ' '.join(self.entry.parameterlist))
> +        self.check_sections(ln, declaration_name, decl_type, self.entry.sectcheck)
>  
>          # Adjust declaration for better display
>          declaration = KernRe(r'([\{;])').sub(r'\1\n', declaration)
> @@ -1032,9 +1030,7 @@ class KernelDoc:
>                            f"expecting prototype for {self.entry.identifier}(). Prototype was for {declaration_name}() instead")
>              return
>  
> -        prms = " ".join(self.entry.parameterlist)
> -        self.check_sections(ln, declaration_name, "function",
> -                            self.entry.sectcheck, prms)
> +        self.check_sections(ln, declaration_name, "function", self.entry.sectcheck)
>  
>          self.check_return_section(ln, declaration_name, return_type)
>  



Thanks,
Mauro

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ