History

docs: kdoc: add a couple more comments in create_parameter_list()

Make what the final code is doing a bit more clear to slow readers like me.

Jonathan Corbet committed 1 year ago

Commit 8f05fbc1 parent 05d72fe1 file · +7 −1Browse files

Unified · Split

scripts/lib/kdoc/kdoc_parser.py+7−1
@@ -568,12 +568,18 @@ class KernelDoc: · 567 unmodified lines
568568
569569 bitfield_re = KernRe(r'(.*?):(\w+)')
570570 for param in args:
571+ #
572+ # For pointers, shift the star(s) from the variable name to the
573+ # type declaration.
574+ #
571575 r = KernRe(r'^(\*+)\s*(.*)')
572576 if r.match(param):
573577 self.push_parameter(ln, decl_type, r.group(2),
574578 f"{dtype} {r.group(1)}",
575579 arg, declaration_name)
576−
580+ #
581+ # Perform a similar shift for bitfields.
582+ #
577583 elif bitfield_re.search(param):
578584 if dtype != "": # Skip unnamed bit-fields
579585 self.push_parameter(ln, decl_type, bitfield_re.group(1),