> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Mauro Carvalho Chehab
> Sent: Thursday, January 29, 2026 9:08 AM
> To: Jonathan Corbet <[email protected]>; Linux Doc Mailing List <linux-
> [email protected]>
> Cc: Mauro Carvalho Chehab <[email protected]>;
> [email protected]; [email protected]; linux-
> [email protected]; [email protected];
> [email protected]; Mauro Carvalho Chehab <[email protected]>;
> Randy Dunlap <[email protected]>
> Subject: [Intel-wired-lan] [PATCH v3 07/30] docs: kdoc_parser: fix
> variable regexes to work with size_t
> 
> The regular expressions meant to pick variable types are too
> naive: they forgot that the type word may contain underlines.
> 
> Co-developed-by: Randy Dunlap <[email protected]>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> Acked-by: Randy Dunlap <[email protected]>
> Tested-by: Randy Dunlap <[email protected]>
> ---
>  tools/lib/python/kdoc/kdoc_parser.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/lib/python/kdoc/kdoc_parser.py
> b/tools/lib/python/kdoc/kdoc_parser.py
> index 64165d8df84e..201c4f7298d7 100644
> --- a/tools/lib/python/kdoc/kdoc_parser.py
> +++ b/tools/lib/python/kdoc/kdoc_parser.py
> @@ -1027,14 +1027,14 @@ class KernelDoc:
> 
>          default_val = None
> 
> -        r= KernRe(OPTIONAL_VAR_ATTR +
> r"\w.*\s+(?:\*+)?([\w_]+)\s*[\d\]\[]*\s*(=.*)?")
> +        r= KernRe(OPTIONAL_VAR_ATTR +
> r"[\w_]*\s+(?:\*+)?([\w_]+)\s*[\d\]\[]*\s*(=.*)?")
>          if r.match(proto):
>              if not declaration_name:
>                  declaration_name = r.group(1)
> 
>              default_val = r.group(2)
>          else:
> -            r= KernRe(OPTIONAL_VAR_ATTR +
> r"(?:\w.*)?\s+(?:\*+)?(?:[\w_]+)\s*[\d\]\[]*\s*(=.*)?")
> +            r= KernRe(OPTIONAL_VAR_ATTR +
> r"(?:[\w_]*)?\s+(?:\*+)?(?:[\w_]+)\s*[\d\]\[]*\s*(=.*)?")
>          if r.match(proto):
>              default_val = r.group(1)
> 
> --
> 2.52.0

Reviewed-by: Aleksandr Loktionov <[email protected]>

Reply via email to