scripts/kernel-doc.py: fix handling of doc output check

The filtering logic was seeking for the DOC name to check for
symbols, but such data is stored only inside a section. Add it
to the output_declaration, as it is quicker/easier to check
the declaration name than to check inside each section.

While here, make sure that the output for both ReST and man
after filtering will be similar to what kernel-doc Perl
version does.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/6d8b77af85295452c0191863ea1041f4195aeaaf.1744106242.git.mchehab+huawei@kernel.org
This commit is contained in:
Mauro Carvalho Chehab
2025-04-08 18:09:18 +08:00
committed by Jonathan Corbet
parent c3597ab27b
commit 408269ae35
2 changed files with 14 additions and 18 deletions

View File

@@ -1198,6 +1198,7 @@ class KernelDoc:
else:
self.entry.section = doc_block.group(1)
self.entry.identifier = self.entry.section
self.state = self.STATE_DOCBLOCK
return
@@ -1628,7 +1629,7 @@ class KernelDoc:
if doc_end.search(line):
self.dump_section()
self.output_declaration("doc", None,
self.output_declaration("doc", self.entry.identifier,
sectionlist=self.entry.sectionlist,
sections=self.entry.sections,
section_start_lines=self.entry.section_start_lines,