]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
docs: kdoc: tidy up space removal in create_parameter_list()
authorJonathan Corbet <corbet@lwn.net>
Thu, 14 Aug 2025 15:40:30 +0000 (09:40 -0600)
committerJonathan Corbet <corbet@lwn.net>
Mon, 18 Aug 2025 16:19:19 +0000 (10:19 -0600)
Remove a redundant test and add a comment describing what the space removal
is doing.

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250814154035.328769-3-corbet@lwn.net
scripts/lib/kdoc/kdoc_parser.py

index 96e3fe4ec4318905029653028c3875a8778d5b76..53051ce831bae95e8db353891af592db4c57c30f 100644 (file)
@@ -545,12 +545,14 @@ class KernelDoc:
                                     arg, declaration_name)
 
             elif arg:
+                #
+                # Clean up extraneous spaces and split the string at commas; the first
+                # element of the resulting list will also include the type information.
+                #
                 arg = KernRe(r'\s*:\s*').sub(":", arg)
                 arg = KernRe(r'\s*\[').sub('[', arg)
-
                 args = KernRe(r'\s*,\s*').split(arg)
-                if args[0] and '*' in args[0]:
-                    args[0] = re.sub(r'(\*+)\s*', r' \1', args[0])
+                args[0] = re.sub(r'(\*+)\s*', r' \1', args[0])
 
                 first_arg = []
                 r = KernRe(r'^(.*\s+)(.*?\[.*\].*)$')