From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH] kernel-doc: Fix symbol matching for dropped suffixes
Date: Sat, 7 Jun 2025 14:21:05 +0200 [thread overview]
Message-ID: <20250607142105.2e768300@foz.lan> (raw)
In-Reply-To: <20250606141543.1285671-1-willy@infradead.org>
Em Fri, 6 Jun 2025 15:15:42 +0100
"Matthew Wilcox (Oracle)" <willy@infradead.org> escreveu:
> 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)
For now, this sounds ok to me.
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
>
> def process_normal(self, ln, line):
Thanks,
Mauro
next prev parent reply other threads:[~2025-06-07 12:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 14:15 [PATCH] kernel-doc: Fix symbol matching for dropped suffixes Matthew Wilcox (Oracle)
2025-06-07 12:21 ` Mauro Carvalho Chehab [this message]
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=20250607142105.2e768300@foz.lan \
--to=mchehab+huawei@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rdunlap@infradead.org \
--cc=willy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.