mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
kernel-doc: Fix symbol matching for dropped suffixes
The support for dropping "_noprof" missed dropping the suffix from
exported symbols. That meant that using the :export: feature would
look for kernel-doc for (eg) krealloc_noprof() and not find the
kernel-doc for krealloc().
Fixes: 51a7bf0238
(scripts/kernel-doc: drop "_noprof" on function prototypes)
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250606141543.1285671-1-willy@infradead.org
This commit is contained in:
parent
97d91036a4
commit
27ad33b6b3
@ -1171,16 +1171,24 @@ class KernelDoc:
|
|||||||
with a staticmethod decorator.
|
with a staticmethod decorator.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# We support documenting some exported symbols with different
|
||||||
|
# names. A horrible hack.
|
||||||
|
suffixes = [ '_noprof' ]
|
||||||
|
|
||||||
# Note: it accepts only one EXPORT_SYMBOL* per line, as having
|
# Note: it accepts only one EXPORT_SYMBOL* per line, as having
|
||||||
# multiple export lines would violate Kernel coding style.
|
# multiple export lines would violate Kernel coding style.
|
||||||
|
|
||||||
if export_symbol.search(line):
|
if export_symbol.search(line):
|
||||||
symbol = export_symbol.group(2)
|
symbol = export_symbol.group(2)
|
||||||
|
for suffix in suffixes:
|
||||||
|
symbol = symbol.removesuffix(suffix)
|
||||||
function_set.add(symbol)
|
function_set.add(symbol)
|
||||||
return
|
return
|
||||||
|
|
||||||
if export_symbol_ns.search(line):
|
if export_symbol_ns.search(line):
|
||||||
symbol = export_symbol_ns.group(2)
|
symbol = export_symbol_ns.group(2)
|
||||||
|
for suffix in suffixes:
|
||||||
|
symbol = symbol.removesuffix(suffix)
|
||||||
function_set.add(symbol)
|
function_set.add(symbol)
|
||||||
|
|
||||||
def process_normal(self, ln, line):
|
def process_normal(self, ln, line):
|
||||||
|
Loading…
Reference in New Issue
Block a user