[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEHwdoNCrF4-KY_i@casper.infradead.org>
Date: Thu, 5 Jun 2025 20:31:02 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Jonathan Corbet <corbet@....net>
Cc: Randy Dunlap <rdunlap@...radead.org>, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>
Subject: Re: [PATCH] scripts/kernel-doc: drop "_noprof" on function prototypes
On Thu, Jun 05, 2025 at 01:18:50PM -0600, Jonathan Corbet wrote:
> Matthew Wilcox <willy@...radead.org> writes:
> > This turns out not to be enough. For example, krealloc() is
> > currently undocumented. This is because we match the function name
> > in EXPORT_SYMBOL() against the function name in the comment, and they
> > don't match. This patch restores the documentation, although only
> > for the python version of kernel-doc, and I'm pretty sure there's a
> > better way to do it (eg building it into the export_symbol* regexes).
> > I can turn this into a proper patch if this is the way to go, but for
> > now it's just to illustrate the problem.
>
> FWIW, I have no problem with leaving the perl version behind, I expect
> we'll drop it in 6.17.
>
> (Meanwhile I don't object to your fix as a short-term workaround)
OK, will give Mauro 24 hours to comment, then resend as a patch if
there are no objections.
> We see other variants of this problem out there, where we want to
> document foo(), but that's really just a macro calling _foo(), where the
> real code is.
>
> I wonder if we could add some sort of a marker to the kerneldoc comment
> saying "we are documenting foo(), but do you checks against _foo()"
> instead? That would be more general than trying to keep a list of
> suffixes to hack off.
kernel-doc is our own format, so sure, we can add whatever marker
we want to it. I think it's not quite general enough because we have
situations like:
static inline void foo(int x)
{
numa_foo(x, NUMA_NO_NODE);
};
/**
* foo - Frobnicate
* @x: How many
* @nid: Which node
*/
void numa_foo(int x, int node)
{ .. }
and now we're documenting a parameter that doesn't exist. The only
solution is to move the kdoc to the header file, which is annoying for
everyone. Or replicate the declaration in the C file and kdoc it there.
Powered by blists - more mailing lists