On Thu, Jun 05, 2025 at 01:18:50PM -0600, Jonathan Corbet wrote: > Matthew Wilcox <willy@xxxxxxxxxxxxx> 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.