mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
docs: kdoc: Coalesce parameter-list handling
Callers to output_declaration() always pass the parameter information from self.entry; remove all of the boilerplate arguments and just get at that information directly. Formalize its placement in the KdocItem class. It would be nice to get rid of parameterlist as well, but that has the effect of reordering the output of function parameters and struct fields to match the order in the kerneldoc comment rather than in the declaration. One could argue about which is more correct, but the ordering has been left unchanged for now. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
@@ -278,7 +278,9 @@ class KernelDoc:
|
||||
if section in sections and not sections[section].rstrip():
|
||||
del sections[section]
|
||||
item.set_sections(sections, self.entry.section_start_lines)
|
||||
|
||||
item.set_params(self.entry.parameterlist, self.entry.parameterdescs,
|
||||
self.entry.parametertypes,
|
||||
self.entry.parameterdesc_start_lines)
|
||||
self.entries.append(item)
|
||||
|
||||
self.config.log.debug("Output: %s:%s = %s", dtype, name, pformat(args))
|
||||
@@ -790,10 +792,6 @@ class KernelDoc:
|
||||
self.output_declaration(decl_type, declaration_name,
|
||||
struct=declaration_name,
|
||||
definition=declaration,
|
||||
parameterlist=self.entry.parameterlist,
|
||||
parameterdescs=self.entry.parameterdescs,
|
||||
parametertypes=self.entry.parametertypes,
|
||||
parameterdesc_start_lines=self.entry.parameterdesc_start_lines,
|
||||
purpose=self.entry.declaration_purpose)
|
||||
|
||||
def dump_enum(self, ln, proto):
|
||||
@@ -873,9 +871,6 @@ class KernelDoc:
|
||||
|
||||
self.output_declaration('enum', declaration_name,
|
||||
enum=declaration_name,
|
||||
parameterlist=self.entry.parameterlist,
|
||||
parameterdescs=self.entry.parameterdescs,
|
||||
parameterdesc_start_lines=self.entry.parameterdesc_start_lines,
|
||||
purpose=self.entry.declaration_purpose)
|
||||
|
||||
def dump_declaration(self, ln, prototype):
|
||||
@@ -1039,10 +1034,6 @@ class KernelDoc:
|
||||
function=declaration_name,
|
||||
typedef=True,
|
||||
functiontype=return_type,
|
||||
parameterlist=self.entry.parameterlist,
|
||||
parameterdescs=self.entry.parameterdescs,
|
||||
parametertypes=self.entry.parametertypes,
|
||||
parameterdesc_start_lines=self.entry.parameterdesc_start_lines,
|
||||
purpose=self.entry.declaration_purpose,
|
||||
func_macro=func_macro)
|
||||
else:
|
||||
@@ -1050,10 +1041,6 @@ class KernelDoc:
|
||||
function=declaration_name,
|
||||
typedef=False,
|
||||
functiontype=return_type,
|
||||
parameterlist=self.entry.parameterlist,
|
||||
parameterdescs=self.entry.parameterdescs,
|
||||
parametertypes=self.entry.parametertypes,
|
||||
parameterdesc_start_lines=self.entry.parameterdesc_start_lines,
|
||||
purpose=self.entry.declaration_purpose,
|
||||
func_macro=func_macro)
|
||||
|
||||
@@ -1093,10 +1080,6 @@ class KernelDoc:
|
||||
function=declaration_name,
|
||||
typedef=True,
|
||||
functiontype=return_type,
|
||||
parameterlist=self.entry.parameterlist,
|
||||
parameterdescs=self.entry.parameterdescs,
|
||||
parametertypes=self.entry.parametertypes,
|
||||
parameterdesc_start_lines=self.entry.parameterdesc_start_lines,
|
||||
purpose=self.entry.declaration_purpose)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user