From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
linux-doc@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>
Subject: [PATCH] kernel-doc: Fix symbol matching for dropped suffixes
Date: Fri, 6 Jun 2025 15:15:42 +0100 [thread overview]
Message-ID: <20250606141543.1285671-1-willy@infradead.org> (raw)
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: 51a7bf0238c2 (scripts/kernel-doc: drop "_noprof" on function prototypes)
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
scripts/lib/kdoc/kdoc_parser.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
index 062453eefc7a..2c6143f7ca0f 100644
--- a/scripts/lib/kdoc/kdoc_parser.py
+++ b/scripts/lib/kdoc/kdoc_parser.py
@@ -1171,16 +1171,24 @@ class KernelDoc:
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
# multiple export lines would violate Kernel coding style.
if export_symbol.search(line):
symbol = export_symbol.group(2)
+ for suffix in suffixes:
+ symbol = symbol.removesuffix(suffix)
function_set.add(symbol)
return
if export_symbol_ns.search(line):
symbol = export_symbol_ns.group(2)
+ for suffix in suffixes:
+ symbol = symbol.removesuffix(suffix)
function_set.add(symbol)
def process_normal(self, ln, line):
--
2.47.2
next reply other threads:[~2025-06-06 14:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 14:15 Matthew Wilcox (Oracle) [this message]
2025-06-07 12:21 ` [PATCH] kernel-doc: Fix symbol matching for dropped suffixes Mauro Carvalho Chehab
2025-06-09 20:23 ` Jonathan Corbet
2025-06-09 20:53 ` Matthew Wilcox
2025-06-09 21:09 ` Jonathan Corbet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250606141543.1285671-1-willy@infradead.org \
--to=willy@infradead.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rdunlap@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).