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: <20250607121448.11411bf9@foz.lan>
Date: Sat, 7 Jun 2025 12:14:48 +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
Subject: Re: [PATCH 6/9] docs: kdoc: remove the KernelEntry::descr pseudo
 member

Em Fri,  6 Jun 2025 10:34:35 -0600
Jonathan Corbet <corbet@....net> escreveu:

> The entry.descr value used in process_name() is not actually a member of
> the KernelEntry class; it is a bit of local state.  So just manage it
> locally.
> 
> A trim_whitespace() helper was added to clean up the code slightly.
> 
> 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, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
> index 56299695abd1..7c635000f3de 100644
> --- a/scripts/lib/kdoc/kdoc_parser.py
> +++ b/scripts/lib/kdoc/kdoc_parser.py
> @@ -60,6 +60,13 @@ export_symbol_ns = KernRe(r'^\s*EXPORT_SYMBOL_NS(_GPL)?\s*\(\s*(\w+)\s*,\s*"\S+"
>  
>  type_param = KernRe(r"\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)", cache=False)
>  
> +#
> +# A little helper to get rid of excess white space
> +#
> +multi_space = KernRe(r'\s\s+')
> +def trim_whitespace(s):
> +    return multi_space.sub(' ', s.strip())
> +
>  class state:
>      """
>      State machine enums
> @@ -1258,12 +1265,7 @@ class KernelDoc:
>  
>              r = KernRe("[-:](.*)")
>              if r.search(line):
> -                # strip leading/trailing/multiple spaces
> -                self.entry.descr = r.group(1).strip(" ")
> -
> -                r = KernRe(r"\s+")
> -                self.entry.descr = r.sub(" ", self.entry.descr)
> -                self.entry.declaration_purpose = self.entry.descr
> +                self.entry.declaration_purpose = trim_whitespace(r.group(1))
>                  self.state = state.BODY_MAYBE
>              else:
>                  self.entry.declaration_purpose = ""



Thanks,
Mauro

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ