diff options
Diffstat (limited to 'include/linux/moduleparam.h')
-rw-r--r-- | include/linux/moduleparam.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 9d2f1837b3d8..ddaae98c53f9 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -16,15 +16,17 @@ | |||
16 | /* Chosen so that structs with an unsigned long line up. */ | 16 | /* Chosen so that structs with an unsigned long line up. */ |
17 | #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) | 17 | #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) |
18 | 18 | ||
19 | #ifdef MODULE | ||
20 | #define ___module_cat(a,b) __mod_ ## a ## b | 19 | #define ___module_cat(a,b) __mod_ ## a ## b |
21 | #define __module_cat(a,b) ___module_cat(a,b) | 20 | #define __module_cat(a,b) ___module_cat(a,b) |
21 | #ifdef MODULE | ||
22 | #define __MODULE_INFO(tag, name, info) \ | 22 | #define __MODULE_INFO(tag, name, info) \ |
23 | static const char __module_cat(name,__LINE__)[] \ | 23 | static const char __module_cat(name,__LINE__)[] \ |
24 | __used \ | 24 | __used __attribute__((section(".modinfo"), unused, aligned(1))) \ |
25 | __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info | 25 | = __stringify(tag) "=" info |
26 | #else /* !MODULE */ | 26 | #else /* !MODULE */ |
27 | #define __MODULE_INFO(tag, name, info) | 27 | /* This struct is here for syntactic coherency, it is not used */ |
28 | #define __MODULE_INFO(tag, name, info) \ | ||
29 | struct __module_cat(name,__LINE__) {} | ||
28 | #endif | 30 | #endif |
29 | #define __MODULE_PARM_TYPE(name, _type) \ | 31 | #define __MODULE_PARM_TYPE(name, _type) \ |
30 | __MODULE_INFO(parmtype, name##type, #name ":" _type) | 32 | __MODULE_INFO(parmtype, name##type, #name ":" _type) |
@@ -65,9 +67,9 @@ struct kparam_string { | |||
65 | struct kparam_array | 67 | struct kparam_array |
66 | { | 68 | { |
67 | unsigned int max; | 69 | unsigned int max; |
70 | unsigned int elemsize; | ||
68 | unsigned int *num; | 71 | unsigned int *num; |
69 | const struct kernel_param_ops *ops; | 72 | const struct kernel_param_ops *ops; |
70 | unsigned int elemsize; | ||
71 | void *elem; | 73 | void *elem; |
72 | }; | 74 | }; |
73 | 75 | ||
@@ -369,8 +371,9 @@ extern int param_get_invbool(char *buffer, const struct kernel_param *kp); | |||
369 | */ | 371 | */ |
370 | #define module_param_array_named(name, array, type, nump, perm) \ | 372 | #define module_param_array_named(name, array, type, nump, perm) \ |
371 | static const struct kparam_array __param_arr_##name \ | 373 | static const struct kparam_array __param_arr_##name \ |
372 | = { ARRAY_SIZE(array), nump, ¶m_ops_##type, \ | 374 | = { .max = ARRAY_SIZE(array), .num = nump, \ |
373 | sizeof(array[0]), array }; \ | 375 | .ops = ¶m_ops_##type, \ |
376 | .elemsize = sizeof(array[0]), .elem = array }; \ | ||
374 | __module_param_call(MODULE_PARAM_PREFIX, name, \ | 377 | __module_param_call(MODULE_PARAM_PREFIX, name, \ |
375 | ¶m_array_ops, \ | 378 | ¶m_array_ops, \ |
376 | .arr = &__param_arr_##name, \ | 379 | .arr = &__param_arr_##name, \ |