summaryrefslogtreecommitdiff
path: root/include/linux/moduleparam.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-03-26 06:20:51 +0400
committerRusty Russell <rusty@rustcorp.com.au>2012-03-26 06:20:51 +0400
commit8b8252813dee8e8cd453bb219731c36b268c69a7 (patch)
tree0e39d722a48b084d7fa84e2470cf1b33c71a0134 /include/linux/moduleparam.h
parent02608bef8f774c058779546926889a2f2717a499 (diff)
downloadlinux-8b8252813dee8e8cd453bb219731c36b268c69a7.tar.xz
module_param: remove support for bool parameters which are really int.
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. This eliminates that code (though leaves the flags field in the struct, for impending use). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/moduleparam.h')
-rw-r--r--include/linux/moduleparam.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index c47f4d60db0b..4daa895648d9 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -47,9 +47,6 @@ struct kernel_param_ops {
void (*free)(void *arg);
};
-/* Flag bits for kernel_param.flags */
-#define KPARAM_ISBOOL 2
-
struct kernel_param {
const char *name;
const struct kernel_param_ops *ops;
@@ -131,8 +128,7 @@ struct kparam_array
* The ops can have NULL set or get functions.
*/
#define module_param_cb(name, ops, arg, perm) \
- __module_param_call(MODULE_PARAM_PREFIX, \
- name, ops, arg, __same_type((arg), bool *), perm)
+ __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm)
/* On alpha, ia64 and ppc64 relocations to global data cannot go into
read-only sections (which is part of respective UNIX ABI on these
@@ -146,7 +142,7 @@ struct kparam_array
/* This is the fundamental function for registering boot/module
parameters. */
-#define __module_param_call(prefix, name, ops, arg, isbool, perm) \
+#define __module_param_call(prefix, name, ops, arg, perm) \
/* Default value instead of permissions? */ \
static int __param_perm_check_##name __attribute__((unused)) = \
BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \
@@ -155,8 +151,7 @@ struct kparam_array
static struct kernel_param __moduleparam_const __param_##name \
__used \
__attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
- = { __param_str_##name, ops, perm, isbool ? KPARAM_ISBOOL : 0, \
- { arg } }
+ = { __param_str_##name, ops, perm, 0, { arg } }
/* Obsolete - use module_param_cb() */
#define module_param_call(name, set, get, arg, perm) \
@@ -164,7 +159,6 @@ struct kparam_array
{ (void *)set, (void *)get }; \
__module_param_call(MODULE_PARAM_PREFIX, \
name, &__param_ops_##name, arg, \
- __same_type(arg, bool *), \
(perm) + sizeof(__check_old_set_param(set))*0)
/* We don't get oldget: it's often a new-style param_get_uint, etc. */
@@ -245,8 +239,7 @@ static inline void __kernel_param_unlock(void)
*/
#define core_param(name, var, type, perm) \
param_check_##type(name, &(var)); \
- __module_param_call("", name, &param_ops_##type, \
- &var, __same_type(var, bool), perm)
+ __module_param_call("", name, &param_ops_##type, &var, perm)
#endif /* !MODULE */
/**
@@ -264,7 +257,7 @@ static inline void __kernel_param_unlock(void)
= { len, string }; \
__module_param_call(MODULE_PARAM_PREFIX, name, \
&param_ops_string, \
- .str = &__param_string_##name, 0, perm); \
+ .str = &__param_string_##name, perm); \
__MODULE_PARM_TYPE(name, "string")
/**
@@ -403,7 +396,7 @@ extern int param_set_bint(const char *val, const struct kernel_param *kp);
__module_param_call(MODULE_PARAM_PREFIX, name, \
&param_array_ops, \
.arr = &__param_arr_##name, \
- __same_type(array[0], bool), perm); \
+ perm); \
__MODULE_PARM_TYPE(name, "array of " #type)
extern struct kernel_param_ops param_array_ops;