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

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

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