Commit 7a1ebbdf authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Include type information as module info where possible

Module parameters no longer have a type in general, as we use a callback
system (module_param_call()).  However, it's useful to include type
information in the commonly-used wrappers: module_param,
module_param_string and module_param_array.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent db8f4702
...@@ -64,7 +64,8 @@ struct kparam_array ...@@ -64,7 +64,8 @@ struct kparam_array
param_set_XXX and param_check_XXX. */ param_set_XXX and param_check_XXX. */
#define module_param_named(name, value, type, perm) \ #define module_param_named(name, value, type, perm) \
param_check_##type(name, &(value)); \ param_check_##type(name, &(value)); \
module_param_call(name, param_set_##type, param_get_##type, &value, perm) module_param_call(name, param_set_##type, param_get_##type, &value, perm); \
__MODULE_INFO(parmtype, name##type, #name ":" #type)
#define module_param(name, type, perm) \ #define module_param(name, type, perm) \
module_param_named(name, name, type, perm) module_param_named(name, name, type, perm)
...@@ -74,7 +75,8 @@ struct kparam_array ...@@ -74,7 +75,8 @@ struct kparam_array
static struct kparam_string __param_string_##name \ static struct kparam_string __param_string_##name \
= { len, string }; \ = { len, string }; \
module_param_call(name, param_set_copystring, param_get_string, \ module_param_call(name, param_set_copystring, param_get_string, \
&__param_string_##name, perm) &__param_string_##name, perm); \
__MODULE_INFO(parmtype, name##type, #name ":string")
/* Called on module insert or kernel boot */ /* Called on module insert or kernel boot */
extern int parse_args(const char *name, extern int parse_args(const char *name,
...@@ -135,7 +137,8 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp); ...@@ -135,7 +137,8 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp);
= { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\ = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\
sizeof(array[0]), array }; \ sizeof(array[0]), array }; \
module_param_call(name, param_array_set, param_array_get, \ module_param_call(name, param_array_set, param_array_get, \
&__param_arr_##name, perm) &__param_arr_##name, perm); \
__MODULE_INFO(parmtype, name##type, #name ":array of " #type)
#define module_param_array(name, type, nump, perm) \ #define module_param_array(name, type, nump, perm) \
module_param_array_named(name, name, type, nump, perm) module_param_array_named(name, name, type, nump, perm)
......
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