Re: [PATCH v3 56/56] scrpits: kernel-doc: validate kernel-doc markup with the actual names

From: Matthew Wilcox
Date: Thu Nov 05 2020 - 10:00:26 EST


On Fri, Oct 23, 2020 at 06:33:43PM +0200, Mauro Carvalho Chehab wrote:
> Kernel-doc currently expects that the kernel-doc markup to come
> just before the function/enum/struct/union/typedef prototype.
>
> Yet, if it find things like:
>
> /**
> * refcount_add - add a value to a refcount
> * @i: the value to add to the refcount
> * @r: the refcount
> */
> static inline void __refcount_add(int i, refcount_t *r, int *oldp);
> static inline void refcount_add(int i, refcount_t *r);
>
> Kernel-doc will do the wrong thing:

I wonder if we could change kernel-doc to be (optionally) less verbose.
If we allowed people to write:

/**
* Add a value to a refcount.
* @i: The value to add to the refcount
* @r: The refcount
*/

and had the kernel-doc script pick up the name of the following function
automatically, would that be an improvement we could all agree on?