diff options
author | Jonathan Corbet <corbet@lwn.net> | 2025-08-14 09:40:30 -0600 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2025-08-18 10:19:19 -0600 |
commit | f51b42b99e1d35698e0277337fde2c15ccc29a2b (patch) | |
tree | 75df0c603cc93164bbb5673677d2411134970d51 /scripts/lib/kdoc/kdoc_parser.py | |
parent | 670ec7333a2c4823ac777b70f045cf731525ae5e (diff) |
docs: kdoc: tidy up space removal in create_parameter_list()
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
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
-rw-r--r-- | scripts/lib/kdoc/kdoc_parser.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py index 96e3fe4ec431..53051ce831ba 100644 --- a/scripts/lib/kdoc/kdoc_parser.py +++ b/scripts/lib/kdoc/kdoc_parser.py @@ -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+)(.*?\[.*\].*)$') |