Commit b6d0531e authored by Fabien Dessenne's avatar Fabien Dessenne Committed by Jessica Yu

moduleparam: fix kerneldoc

Document missing @arg in xxx_param_cb().
Describe all parameters of module_param_[named_]unsafe() and all
*_param_cb() to make ./scripts/kernel-doc happy.
Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarFabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: default avatarJessica Yu <jeyu@kernel.org>
parent bf08949c
...@@ -128,6 +128,9 @@ struct kparam_array ...@@ -128,6 +128,9 @@ struct kparam_array
/** /**
* module_param_unsafe - same as module_param but taints kernel * module_param_unsafe - same as module_param but taints kernel
* @name: the variable to alter, and exposed parameter name.
* @type: the type of the parameter
* @perm: visibility in sysfs.
*/ */
#define module_param_unsafe(name, type, perm) \ #define module_param_unsafe(name, type, perm) \
module_param_named_unsafe(name, name, type, perm) module_param_named_unsafe(name, name, type, perm)
...@@ -150,6 +153,10 @@ struct kparam_array ...@@ -150,6 +153,10 @@ struct kparam_array
/** /**
* module_param_named_unsafe - same as module_param_named but taints kernel * module_param_named_unsafe - same as module_param_named but taints kernel
* @name: a valid C identifier which is the parameter name.
* @value: the actual lvalue to alter.
* @type: the type of the parameter
* @perm: visibility in sysfs.
*/ */
#define module_param_named_unsafe(name, value, type, perm) \ #define module_param_named_unsafe(name, value, type, perm) \
param_check_##type(name, &(value)); \ param_check_##type(name, &(value)); \
...@@ -160,6 +167,7 @@ struct kparam_array ...@@ -160,6 +167,7 @@ struct kparam_array
* module_param_cb - general callback for a module/cmdline parameter * module_param_cb - general callback for a module/cmdline parameter
* @name: a valid C identifier which is the parameter name. * @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter. * @ops: the set & get operations for this parameter.
* @arg: args for @ops
* @perm: visibility in sysfs. * @perm: visibility in sysfs.
* *
* The ops can have NULL set or get functions. * The ops can have NULL set or get functions.
...@@ -171,36 +179,96 @@ struct kparam_array ...@@ -171,36 +179,96 @@ struct kparam_array
__module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, \ __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, \
KERNEL_PARAM_FL_UNSAFE) KERNEL_PARAM_FL_UNSAFE)
#define __level_param_cb(name, ops, arg, perm, level) \
__module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, level, 0)
/** /**
* <level>_param_cb - general callback for a module/cmdline parameter * core_param_cb - general callback for a module/cmdline parameter
* to be evaluated before certain initcall level * to be evaluated before core initcall level
* @name: a valid C identifier which is the parameter name. * @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter. * @ops: the set & get operations for this parameter.
* @arg: args for @ops
* @perm: visibility in sysfs. * @perm: visibility in sysfs.
* *
* The ops can have NULL set or get functions. * The ops can have NULL set or get functions.
*/ */
#define __level_param_cb(name, ops, arg, perm, level) \
__module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, level, 0)
#define core_param_cb(name, ops, arg, perm) \ #define core_param_cb(name, ops, arg, perm) \
__level_param_cb(name, ops, arg, perm, 1) __level_param_cb(name, ops, arg, perm, 1)
/**
* postcore_param_cb - general callback for a module/cmdline parameter
* to be evaluated before postcore initcall level
* @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter.
* @arg: args for @ops
* @perm: visibility in sysfs.
*
* The ops can have NULL set or get functions.
*/
#define postcore_param_cb(name, ops, arg, perm) \ #define postcore_param_cb(name, ops, arg, perm) \
__level_param_cb(name, ops, arg, perm, 2) __level_param_cb(name, ops, arg, perm, 2)
/**
* arch_param_cb - general callback for a module/cmdline parameter
* to be evaluated before arch initcall level
* @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter.
* @arg: args for @ops
* @perm: visibility in sysfs.
*
* The ops can have NULL set or get functions.
*/
#define arch_param_cb(name, ops, arg, perm) \ #define arch_param_cb(name, ops, arg, perm) \
__level_param_cb(name, ops, arg, perm, 3) __level_param_cb(name, ops, arg, perm, 3)
/**
* subsys_param_cb - general callback for a module/cmdline parameter
* to be evaluated before subsys initcall level
* @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter.
* @arg: args for @ops
* @perm: visibility in sysfs.
*
* The ops can have NULL set or get functions.
*/
#define subsys_param_cb(name, ops, arg, perm) \ #define subsys_param_cb(name, ops, arg, perm) \
__level_param_cb(name, ops, arg, perm, 4) __level_param_cb(name, ops, arg, perm, 4)
/**
* fs_param_cb - general callback for a module/cmdline parameter
* to be evaluated before fs initcall level
* @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter.
* @arg: args for @ops
* @perm: visibility in sysfs.
*
* The ops can have NULL set or get functions.
*/
#define fs_param_cb(name, ops, arg, perm) \ #define fs_param_cb(name, ops, arg, perm) \
__level_param_cb(name, ops, arg, perm, 5) __level_param_cb(name, ops, arg, perm, 5)
/**
* device_param_cb - general callback for a module/cmdline parameter
* to be evaluated before device initcall level
* @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter.
* @arg: args for @ops
* @perm: visibility in sysfs.
*
* The ops can have NULL set or get functions.
*/
#define device_param_cb(name, ops, arg, perm) \ #define device_param_cb(name, ops, arg, perm) \
__level_param_cb(name, ops, arg, perm, 6) __level_param_cb(name, ops, arg, perm, 6)
/**
* late_param_cb - general callback for a module/cmdline parameter
* to be evaluated before late initcall level
* @name: a valid C identifier which is the parameter name.
* @ops: the set & get operations for this parameter.
* @arg: args for @ops
* @perm: visibility in sysfs.
*
* The ops can have NULL set or get functions.
*/
#define late_param_cb(name, ops, arg, perm) \ #define late_param_cb(name, ops, arg, perm) \
__level_param_cb(name, ops, arg, perm, 7) __level_param_cb(name, ops, arg, perm, 7)
...@@ -263,6 +331,10 @@ static inline void kernel_param_unlock(struct module *mod) ...@@ -263,6 +331,10 @@ static inline void kernel_param_unlock(struct module *mod)
/** /**
* core_param_unsafe - same as core_param but taints kernel * core_param_unsafe - same as core_param but taints kernel
* @name: the name of the cmdline and sysfs parameter (often the same as var)
* @var: the variable
* @type: the type of the parameter
* @perm: visibility in sysfs
*/ */
#define core_param_unsafe(name, var, type, perm) \ #define core_param_unsafe(name, var, type, perm) \
param_check_##type(name, &(var)); \ param_check_##type(name, &(var)); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment