Commit 9a71af2c3627b379b7c31917a7f6ee0d29bc559b
1 parent
ab8e2eb722
Exists in
master
and in
7 other branches
module_param: invbool should take a 'bool', not an 'int'
It takes an 'int' for historical reasons, and there are only two users: simply switch it over to bool. The other user (uvesafb.c) will get a (harmless-on-x86) warning until the next patch is applied. Cc: Brad Douglas <brad@neruo.com> Cc: Michal Januszewski <spock@gentoo.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Showing 3 changed files with 4 additions and 4 deletions Side-by-side Diff
drivers/video/aty/aty128fb.c
include/linux/moduleparam.h
... | ... | @@ -192,7 +192,7 @@ |
192 | 192 | |
193 | 193 | extern int param_set_invbool(const char *val, struct kernel_param *kp); |
194 | 194 | extern int param_get_invbool(char *buffer, struct kernel_param *kp); |
195 | -#define param_check_invbool(name, p) __param_check(name, p, int) | |
195 | +#define param_check_invbool(name, p) __param_check(name, p, bool) | |
196 | 196 | |
197 | 197 | /* Comma-separated array: *nump is set to number they actually specified. */ |
198 | 198 | #define module_param_array_named(name, array, type, nump, perm) \ |
kernel/params.c
... | ... | @@ -272,13 +272,13 @@ |
272 | 272 | dummy.arg = &boolval; |
273 | 273 | ret = param_set_bool(val, &dummy); |
274 | 274 | if (ret == 0) |
275 | - *(int *)kp->arg = !boolval; | |
275 | + *(bool *)kp->arg = !boolval; | |
276 | 276 | return ret; |
277 | 277 | } |
278 | 278 | |
279 | 279 | int param_get_invbool(char *buffer, struct kernel_param *kp) |
280 | 280 | { |
281 | - return sprintf(buffer, "%c", (*(int *)kp->arg) ? 'N' : 'Y'); | |
281 | + return sprintf(buffer, "%c", (*(bool *)kp->arg) ? 'N' : 'Y'); | |
282 | 282 | } |
283 | 283 | |
284 | 284 | /* We break the rule and mangle the string. */ |