Re: [PATCH V2] watchdog: Improve watchdog_dev function documentation

From: Randy Dunlap
Date: Fri Feb 11 2022 - 13:08:22 EST


Hi Daniel,

On 2/11/22 06:30, Daniel Bristot de Oliveira wrote:
> Adjust function comments to the kernel doc format. It
> also adjusts some variable names and adds return values.
>
> No functional change.
>
> Changes from V1:
> Change "Returns" to "Return:" (Randy Dunlap)
>
> Cc: Wim Van Sebroeck <wim@xxxxxxxxxxxxxxxxxx>
> Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
> Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
> Cc: linux-watchdog@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>


scripts/kernel-doc throws one warning:
watchdog_dev.c:1194: warning: contents before sections

which is a bug in the script IMO.
I would just ignore this one.
(see more below)


Tested-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Acked-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

Thanks.

> ---
> drivers/watchdog/watchdog_dev.c | 244 ++++++++++++++++----------------
> 1 file changed, 125 insertions(+), 119 deletions(-)
>
> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
> index 3a3d8b5c7ad5..54903f3c851e 100644
> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c


scripts/kernel-doc does not nicely handle a function that has
no parameters (hence no @param descriptions) that is followed
by a function description.

Adding one line (I am not suggesting this as a patch) stops the
warning:

* @void: none


This is the function that kernel-doc complains about
(nothing wrong with it):

/**
* watchdog_dev_init - init dev part of watchdog core
*
* Allocate a range of chardev nodes to use for watchdog devices.
*
* Return: 0 if successful, error otherwise.
*/
int __init watchdog_dev_init(void)
{


--
~Randy