aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/moduleparam.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2010-08-12 01:04:40 -0400
committerRusty Russell <rusty@rustcorp.com.au>2010-08-11 09:34:41 -0400
commita6de51b2787012ba3ab62c7d50df1b749b83d5f0 (patch)
treee3053c23297b57bb85b5abcabfd49635511ec140 /include/linux/moduleparam.h
parent4ef2db016aab27af05a95aeab1c30ad3f2fed7b9 (diff)
param: don't deref arg in __same_type() checks
gcc allows this when arg is a function, but sparse complains: drivers/char/ipmi/ipmi_watchdog.c:303:1: error: cannot dereference this type drivers/char/ipmi/ipmi_watchdog.c:307:1: error: cannot dereference this type drivers/char/ipmi/ipmi_watchdog.c:311:1: error: cannot dereference this type Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Tested-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/moduleparam.h')
-rw-r--r--include/linux/moduleparam.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 893549c04265..9d2f1837b3d8 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -125,7 +125,7 @@ struct kparam_array
125 */ 125 */
126#define module_param_cb(name, ops, arg, perm) \ 126#define module_param_cb(name, ops, arg, perm) \
127 __module_param_call(MODULE_PARAM_PREFIX, \ 127 __module_param_call(MODULE_PARAM_PREFIX, \
128 name, ops, arg, __same_type(*(arg), bool), perm) 128 name, ops, arg, __same_type((arg), bool *), perm)
129 129
130/* On alpha, ia64 and ppc64 relocations to global data cannot go into 130/* On alpha, ia64 and ppc64 relocations to global data cannot go into
131 read-only sections (which is part of respective UNIX ABI on these 131 read-only sections (which is part of respective UNIX ABI on these
@@ -157,7 +157,7 @@ struct kparam_array
157 { (void *)set, (void *)get }; \ 157 { (void *)set, (void *)get }; \
158 __module_param_call(MODULE_PARAM_PREFIX, \ 158 __module_param_call(MODULE_PARAM_PREFIX, \
159 name, &__param_ops_##name, arg, \ 159 name, &__param_ops_##name, arg, \
160 __same_type(*(arg), bool), \ 160 __same_type(arg, bool *), \
161 (perm) + sizeof(__check_old_set_param(set))*0) 161 (perm) + sizeof(__check_old_set_param(set))*0)
162 162
163/* We don't get oldget: it's often a new-style param_get_uint, etc. */ 163/* We don't get oldget: it's often a new-style param_get_uint, etc. */
@@ -330,9 +330,9 @@ extern int param_get_bool(char *buffer, const struct kernel_param *kp);
330#define param_check_bool(name, p) \ 330#define param_check_bool(name, p) \
331 static inline void __check_##name(void) \ 331 static inline void __check_##name(void) \
332 { \ 332 { \
333 BUILD_BUG_ON(!__same_type(*(p), bool) && \ 333 BUILD_BUG_ON(!__same_type((p), bool *) && \
334 !__same_type(*(p), unsigned int) && \ 334 !__same_type((p), unsigned int *) && \
335 !__same_type(*(p), int)); \ 335 !__same_type((p), int *)); \
336 } 336 }
337 337
338extern struct kernel_param_ops param_ops_invbool; 338extern struct kernel_param_ops param_ops_invbool;