Skip to content

Commit 9a71af2

Browse files
committed
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 <[email protected]> Cc: Michal Januszewski <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
1 parent ab8e2eb commit 9a71af2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/video/aty/aty128fb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static int default_crt_on __devinitdata = 0;
354354
static int default_lcd_on __devinitdata = 1;
355355

356356
#ifdef CONFIG_MTRR
357-
static int mtrr = 1;
357+
static bool mtrr = true;
358358
#endif
359359

360360
#ifdef CONFIG_PMAC_BACKLIGHT

include/linux/moduleparam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ extern int param_get_bool(char *buffer, struct kernel_param *kp);
192192

193193
extern int param_set_invbool(const char *val, struct kernel_param *kp);
194194
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)
196196

197197
/* Comma-separated array: *nump is set to number they actually specified. */
198198
#define module_param_array_named(name, array, type, nump, perm) \

kernel/params.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ int param_set_invbool(const char *val, struct kernel_param *kp)
272272
dummy.arg = &boolval;
273273
ret = param_set_bool(val, &dummy);
274274
if (ret == 0)
275-
*(int *)kp->arg = !boolval;
275+
*(bool *)kp->arg = !boolval;
276276
return ret;
277277
}
278278

279279
int param_get_invbool(char *buffer, struct kernel_param *kp)
280280
{
281-
return sprintf(buffer, "%c", (*(int *)kp->arg) ? 'N' : 'Y');
281+
return sprintf(buffer, "%c", (*(bool *)kp->arg) ? 'N' : 'Y');
282282
}
283283

284284
/* We break the rule and mangle the string. */

0 commit comments

Comments
 (0)