2019-11-29 15:41:35

by Fabien DESSENNE

[permalink] [raw]
Subject: [PATCH v2] moduleparam: fix kerneldoc

Document missing @args in xxx_param_cb().

Signed-off-by: Fabien Dessenne <[email protected]>
---
Changes since v1: do not replace 'lvalue' with 'value'
---
include/linux/moduleparam.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index e5c3e23..5215198 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -160,6 +160,7 @@ struct kparam_array
* module_param_cb - general callback for a module/cmdline parameter
* @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter.
+ * @args: args for @ops
* @perm: visibility in sysfs.
*
* The ops can have NULL set or get functions.
@@ -176,6 +177,7 @@ struct kparam_array
* to be evaluated before certain initcall level
* @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter.
+ * @args: args for @ops
* @perm: visibility in sysfs.
*
* The ops can have NULL set or get functions.
--
2.7.4


2019-11-29 21:44:15

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH v2] moduleparam: fix kerneldoc

On 11/29/19 7:39 AM, Fabien Dessenne wrote:
> Document missing @args in xxx_param_cb().
>
> Signed-off-by: Fabien Dessenne <[email protected]>
> ---
> Changes since v1: do not replace 'lvalue' with 'value'
> ---
> include/linux/moduleparam.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
> index e5c3e23..5215198 100644
> --- a/include/linux/moduleparam.h
> +++ b/include/linux/moduleparam.h
> @@ -160,6 +160,7 @@ struct kparam_array
> * module_param_cb - general callback for a module/cmdline parameter
> * @name: a valid C identifier which is the parameter name.
> * @ops: the set & get operations for this parameter.
> + * @args: args for @ops

should be @arg:

> * @perm: visibility in sysfs.
> *
> * The ops can have NULL set or get functions.
> @@ -176,6 +177,7 @@ struct kparam_array
> * to be evaluated before certain initcall level
> * @name: a valid C identifier which is the parameter name.
> * @ops: the set & get operations for this parameter.
> + * @args: args for @ops

should be @arg:

> * @perm: visibility in sysfs.
> *
> * The ops can have NULL set or get functions.
>

and @level needs to be documented here also.

I tested this patch with
$ ./scripts/kernel-doc -none -function module_param_cb include/linux/moduleparam.h

scripts/kernel-doc does not like this line:
* <level>_param_cb - general callback for a module/cmdline parameter

It needs to match the macro name __level_param_cb.

--
~Randy