aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/moduleparam.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-06-12 23:46:56 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-06-12 08:16:56 -0400
commit45fcc70c0b6ee0c508e1fdb5fef735c3546803f4 (patch)
tree15ea34cf77ecd9bbd4f78259ced012f18a26e01b /include/linux/moduleparam.h
parent9a71af2c3627b379b7c31917a7f6ee0d29bc559b (diff)
module_param: split perm field into flags and perm
Impact: cleanup Rather than hack KPARAM_KMALLOCED into the perm field, separate it out. Since the perm field was 32 bits and only needs 16, we don't add bloat. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/moduleparam.h')
-rw-r--r--include/linux/moduleparam.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 9bbca8e8c19f..009a5f768768 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -36,9 +36,13 @@ typedef int (*param_set_fn)(const char *val, struct kernel_param *kp);
36/* Returns length written or -errno. Buffer is 4k (ie. be short!) */ 36/* Returns length written or -errno. Buffer is 4k (ie. be short!) */
37typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); 37typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp);
38 38
39/* Flag bits for kernel_param.flags */
40#define KPARAM_KMALLOCED 1
41
39struct kernel_param { 42struct kernel_param {
40 const char *name; 43 const char *name;
41 unsigned int perm; 44 u16 perm;
45 u16 flags;
42 param_set_fn set; 46 param_set_fn set;
43 param_get_fn get; 47 param_get_fn get;
44 union { 48 union {
@@ -88,7 +92,7 @@ struct kparam_array
88 static struct kernel_param __moduleparam_const __param_##name \ 92 static struct kernel_param __moduleparam_const __param_##name \
89 __used \ 93 __used \
90 __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ 94 __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
91 = { __param_str_##name, perm, set, get, { arg } } 95 = { __param_str_##name, perm, 0, set, get, { arg } }
92 96
93#define module_param_call(name, set, get, arg, perm) \ 97#define module_param_call(name, set, get, arg, perm) \
94 __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm) 98 __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm)