[PATCH 12/12] docs: kdoc: a few final dump_struct() touches

Jonathan Corbet posted 12 patches 2 months ago
There is a newer version of this series
[PATCH 12/12] docs: kdoc: a few final dump_struct() touches
Posted by Jonathan Corbet 2 months ago
Add a couple more comments so that each phase of the process is
now clearly marked.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
 scripts/lib/kdoc/kdoc_parser.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
index 131956d89f84..fa2041276f8c 100644
--- a/scripts/lib/kdoc/kdoc_parser.py
+++ b/scripts/lib/kdoc/kdoc_parser.py
@@ -801,14 +801,15 @@ class KernelDoc:
         nested = NestedMatch()
         for search, sub in struct_nested_prefixes:
             members = nested.sub(search, sub, members)
-
-        # Keeps the original declaration as-is
+        #
+        # Deal with embedded struct and union members, and drop enums entirely.
+        #
         declaration = members
         members = self.rewrite_struct_members(members)
-
-        # Ignore other nested elements, like enums
         members = re.sub(r'(\{[^\{\}]*\})', '', members)
-
+        #
+        # Output the result and we are done.
+        #
         self.create_parameter_list(ln, decl_type, members, ';',
                                    declaration_name)
         self.check_sections(ln, declaration_name, decl_type)
-- 
2.50.1
Re: [PATCH 12/12] docs: kdoc: a few final dump_struct() touches
Posted by Mauro Carvalho Chehab 2 months ago
Em Thu, 31 Jul 2025 18:13:26 -0600
Jonathan Corbet <corbet@lwn.net> escreveu:

> Add a couple more comments so that each phase of the process is
> now clearly marked.

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

> 
> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
> ---
>  scripts/lib/kdoc/kdoc_parser.py | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
> index 131956d89f84..fa2041276f8c 100644
> --- a/scripts/lib/kdoc/kdoc_parser.py
> +++ b/scripts/lib/kdoc/kdoc_parser.py
> @@ -801,14 +801,15 @@ class KernelDoc:
>          nested = NestedMatch()
>          for search, sub in struct_nested_prefixes:
>              members = nested.sub(search, sub, members)
> -
> -        # Keeps the original declaration as-is
> +        #
> +        # Deal with embedded struct and union members, and drop enums entirely.
> +        #
>          declaration = members
>          members = self.rewrite_struct_members(members)
> -
> -        # Ignore other nested elements, like enums
>          members = re.sub(r'(\{[^\{\}]*\})', '', members)
> -
> +        #
> +        # Output the result and we are done.
> +        #
>          self.create_parameter_list(ln, decl_type, members, ';',
>                                     declaration_name)
>          self.check_sections(ln, declaration_name, decl_type)



Thanks,
Mauro