From 78167236e23bb3c80d2b35b693e578a6e56b1171 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 3 May 2007 00:52:51 -0400 Subject: Input: drivers/joystick - fix various sparse warnings Fix various issues pointed by sparse: - module_param_array_named() takes unsigned int as number of parameters argument - shadowing of global variables is not healthy. I think there was once a bug in db9 caused by it. Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/db9.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers/input/joystick/db9.c') diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index c27593bf9978..86ad1027e12a 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c @@ -46,17 +46,17 @@ MODULE_LICENSE("GPL"); struct db9_config { int args[2]; - int nargs; + unsigned int nargs; }; #define DB9_MAX_PORTS 3 -static struct db9_config db9[DB9_MAX_PORTS] __initdata; +static struct db9_config db9_cfg[DB9_MAX_PORTS] __initdata; -module_param_array_named(dev, db9[0].args, int, &db9[0].nargs, 0); +module_param_array_named(dev, db9_cfg[0].args, int, &db9_cfg[0].nargs, 0); MODULE_PARM_DESC(dev, "Describes first attached device (,)"); -module_param_array_named(dev2, db9[1].args, int, &db9[0].nargs, 0); +module_param_array_named(dev2, db9_cfg[1].args, int, &db9_cfg[0].nargs, 0); MODULE_PARM_DESC(dev2, "Describes second attached device (,)"); -module_param_array_named(dev3, db9[2].args, int, &db9[2].nargs, 0); +module_param_array_named(dev3, db9_cfg[2].args, int, &db9_cfg[2].nargs, 0); MODULE_PARM_DESC(dev3, "Describes third attached device (,)"); #define DB9_ARG_PARPORT 0 @@ -680,17 +680,17 @@ static int __init db9_init(void) int err = 0; for (i = 0; i < DB9_MAX_PORTS; i++) { - if (db9[i].nargs == 0 || db9[i].args[DB9_ARG_PARPORT] < 0) + if (db9_cfg[i].nargs == 0 || db9_cfg[i].args[DB9_ARG_PARPORT] < 0) continue; - if (db9[i].nargs < 2) { + if (db9_cfg[i].nargs < 2) { printk(KERN_ERR "db9.c: Device type must be specified.\n"); err = -EINVAL; break; } - db9_base[i] = db9_probe(db9[i].args[DB9_ARG_PARPORT], - db9[i].args[DB9_ARG_MODE]); + db9_base[i] = db9_probe(db9_cfg[i].args[DB9_ARG_PARPORT], + db9_cfg[i].args[DB9_ARG_MODE]); if (IS_ERR(db9_base[i])) { err = PTR_ERR(db9_base[i]); break; -- cgit v1.2.2