Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: kdoc: final dump_function() cleanups

Add some more comments to dump_function(), add some comments, and trim out
an unneeded duplicate output_declaration() call.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>

+13 -17
+13 -17
scripts/lib/kdoc/kdoc_parser.py
··· 999 999 declaration_name) 1000 1000 found = True 1001 1001 break 1002 + # 1003 + # Parsing done; make sure that things are as we expect. 1004 + # 1002 1005 if not found: 1003 1006 self.emit_msg(ln, 1004 1007 f"cannot understand function prototype: '{prototype}'") 1005 1008 return 1006 - 1007 1009 if self.entry.identifier != declaration_name: 1008 - self.emit_msg(ln, 1009 - f"expecting prototype for {self.entry.identifier}(). Prototype was for {declaration_name}() instead") 1010 + self.emit_msg(ln, f"expecting prototype for {self.entry.identifier}(). " 1011 + f"Prototype was for {declaration_name}() instead") 1010 1012 return 1011 - 1012 1013 self.check_sections(ln, declaration_name, "function") 1013 - 1014 1014 self.check_return_section(ln, declaration_name, return_type) 1015 + # 1016 + # Store the result. 1017 + # 1018 + self.output_declaration(decl_type, declaration_name, 1019 + typedef=('typedef' in return_type), 1020 + functiontype=return_type, 1021 + purpose=self.entry.declaration_purpose, 1022 + func_macro=func_macro) 1015 1023 1016 - if 'typedef' in return_type: 1017 - self.output_declaration(decl_type, declaration_name, 1018 - typedef=True, 1019 - functiontype=return_type, 1020 - purpose=self.entry.declaration_purpose, 1021 - func_macro=func_macro) 1022 - else: 1023 - self.output_declaration(decl_type, declaration_name, 1024 - typedef=False, 1025 - functiontype=return_type, 1026 - purpose=self.entry.declaration_purpose, 1027 - func_macro=func_macro) 1028 1024 1029 1025 def dump_typedef(self, ln, proto): 1030 1026 """