Commit 9a71af2c authored by Rusty Russell's avatar Rusty Russell

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: default avatarRusty Russell <rusty@rustcorp.com.au>
parent ab8e2eb7
...@@ -354,7 +354,7 @@ static int default_crt_on __devinitdata = 0; ...@@ -354,7 +354,7 @@ static int default_crt_on __devinitdata = 0;
static int default_lcd_on __devinitdata = 1; static int default_lcd_on __devinitdata = 1;
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
static int mtrr = 1; static bool mtrr = true;
#endif #endif
#ifdef CONFIG_PMAC_BACKLIGHT #ifdef CONFIG_PMAC_BACKLIGHT
......
...@@ -192,7 +192,7 @@ extern int param_get_bool(char *buffer, struct kernel_param *kp); ...@@ -192,7 +192,7 @@ extern int param_get_bool(char *buffer, struct kernel_param *kp);
extern int param_set_invbool(const char *val, struct kernel_param *kp); extern int param_set_invbool(const char *val, struct kernel_param *kp);
extern int param_get_invbool(char *buffer, struct kernel_param *kp); extern int param_get_invbool(char *buffer, struct kernel_param *kp);
#define param_check_invbool(name, p) __param_check(name, p, int) #define param_check_invbool(name, p) __param_check(name, p, bool)
/* Comma-separated array: *nump is set to number they actually specified. */ /* Comma-separated array: *nump is set to number they actually specified. */
#define module_param_array_named(name, array, type, nump, perm) \ #define module_param_array_named(name, array, type, nump, perm) \
......
...@@ -272,13 +272,13 @@ int param_set_invbool(const char *val, struct kernel_param *kp) ...@@ -272,13 +272,13 @@ int param_set_invbool(const char *val, struct kernel_param *kp)
dummy.arg = &boolval; dummy.arg = &boolval;
ret = param_set_bool(val, &dummy); ret = param_set_bool(val, &dummy);
if (ret == 0) if (ret == 0)
*(int *)kp->arg = !boolval; *(bool *)kp->arg = !boolval;
return ret; return ret;
} }
int param_get_invbool(char *buffer, struct kernel_param *kp) int param_get_invbool(char *buffer, struct kernel_param *kp)
{ {
return sprintf(buffer, "%c", (*(int *)kp->arg) ? 'N' : 'Y'); return sprintf(buffer, "%c", (*(bool *)kp->arg) ? 'N' : 'Y');
} }
/* We break the rule and mangle the string. */ /* We break the rule and mangle the string. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment