diff options
Diffstat (limited to 'include/linux/moduleparam.h')
| -rw-r--r-- | include/linux/moduleparam.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index c3eb102a9cc8..204a67743804 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
| @@ -186,14 +186,12 @@ struct kparam_array | |||
| 186 | parameters. */ | 186 | parameters. */ |
| 187 | #define __module_param_call(prefix, name, ops, arg, perm, level) \ | 187 | #define __module_param_call(prefix, name, ops, arg, perm, level) \ |
| 188 | /* Default value instead of permissions? */ \ | 188 | /* Default value instead of permissions? */ \ |
| 189 | static int __param_perm_check_##name __attribute__((unused)) = \ | 189 | static const char __param_str_##name[] = prefix #name; \ |
| 190 | BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \ | ||
| 191 | + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \ | ||
| 192 | static const char __param_str_##name[] = prefix #name; \ | ||
| 193 | static struct kernel_param __moduleparam_const __param_##name \ | 190 | static struct kernel_param __moduleparam_const __param_##name \ |
| 194 | __used \ | 191 | __used \ |
| 195 | __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ | 192 | __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ |
| 196 | = { __param_str_##name, ops, perm, level, { arg } } | 193 | = { __param_str_##name, ops, VERIFY_OCTAL_PERMISSIONS(perm), \ |
| 194 | level, { arg } } | ||
| 197 | 195 | ||
| 198 | /* Obsolete - use module_param_cb() */ | 196 | /* Obsolete - use module_param_cb() */ |
| 199 | #define module_param_call(name, set, get, arg, perm) \ | 197 | #define module_param_call(name, set, get, arg, perm) \ |
| @@ -346,7 +344,7 @@ static inline void destroy_params(const struct kernel_param *params, | |||
| 346 | /* The macros to do compile-time type checking stolen from Jakub | 344 | /* The macros to do compile-time type checking stolen from Jakub |
| 347 | Jelinek, who IIRC came up with this idea for the 2.4 module init code. */ | 345 | Jelinek, who IIRC came up with this idea for the 2.4 module init code. */ |
| 348 | #define __param_check(name, p, type) \ | 346 | #define __param_check(name, p, type) \ |
| 349 | static inline type *__check_##name(void) { return(p); } | 347 | static inline type __always_unused *__check_##name(void) { return(p); } |
| 350 | 348 | ||
| 351 | extern struct kernel_param_ops param_ops_byte; | 349 | extern struct kernel_param_ops param_ops_byte; |
| 352 | extern int param_set_byte(const char *val, const struct kernel_param *kp); | 350 | extern int param_set_byte(const char *val, const struct kernel_param *kp); |
