aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/gamecon.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-05-03 00:52:51 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-05-03 00:52:51 -0400
commit78167236e23bb3c80d2b35b693e578a6e56b1171 (patch)
tree2287a478c80f5eaa79738d4b541bd5a0ddd42de5 /drivers/input/joystick/gamecon.c
parentdec3eb01c2409ca8276c1152c167add66a37d1ba (diff)
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 <dtor@mail.ru>
Diffstat (limited to 'drivers/input/joystick/gamecon.c')
-rw-r--r--drivers/input/joystick/gamecon.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
index c71b58fe225d..1a452e0e5f25 100644
--- a/drivers/input/joystick/gamecon.c
+++ b/drivers/input/joystick/gamecon.c
@@ -48,16 +48,16 @@ MODULE_LICENSE("GPL");
48 48
49struct gc_config { 49struct gc_config {
50 int args[GC_MAX_DEVICES + 1]; 50 int args[GC_MAX_DEVICES + 1];
51 int nargs; 51 unsigned int nargs;
52}; 52};
53 53
54static struct gc_config gc[GC_MAX_PORTS] __initdata; 54static struct gc_config gc_cfg[GC_MAX_PORTS] __initdata;
55 55
56module_param_array_named(map, gc[0].args, int, &gc[0].nargs, 0); 56module_param_array_named(map, gc_cfg[0].args, int, &gc_cfg[0].nargs, 0);
57MODULE_PARM_DESC(map, "Describes first set of devices (<parport#>,<pad1>,<pad2>,..<pad5>)"); 57MODULE_PARM_DESC(map, "Describes first set of devices (<parport#>,<pad1>,<pad2>,..<pad5>)");
58module_param_array_named(map2, gc[1].args, int, &gc[1].nargs, 0); 58module_param_array_named(map2, gc_cfg[1].args, int, &gc_cfg[1].nargs, 0);
59MODULE_PARM_DESC(map2, "Describes second set of devices"); 59MODULE_PARM_DESC(map2, "Describes second set of devices");
60module_param_array_named(map3, gc[2].args, int, &gc[2].nargs, 0); 60module_param_array_named(map3, gc_cfg[2].args, int, &gc_cfg[2].nargs, 0);
61MODULE_PARM_DESC(map3, "Describes third set of devices"); 61MODULE_PARM_DESC(map3, "Describes third set of devices");
62 62
63/* see also gs_psx_delay parameter in PSX support section */ 63/* see also gs_psx_delay parameter in PSX support section */
@@ -810,16 +810,17 @@ static int __init gc_init(void)
810 int err = 0; 810 int err = 0;
811 811
812 for (i = 0; i < GC_MAX_PORTS; i++) { 812 for (i = 0; i < GC_MAX_PORTS; i++) {
813 if (gc[i].nargs == 0 || gc[i].args[0] < 0) 813 if (gc_cfg[i].nargs == 0 || gc_cfg[i].args[0] < 0)
814 continue; 814 continue;
815 815
816 if (gc[i].nargs < 2) { 816 if (gc_cfg[i].nargs < 2) {
817 printk(KERN_ERR "gamecon.c: at least one device must be specified\n"); 817 printk(KERN_ERR "gamecon.c: at least one device must be specified\n");
818 err = -EINVAL; 818 err = -EINVAL;
819 break; 819 break;
820 } 820 }
821 821
822 gc_base[i] = gc_probe(gc[i].args[0], gc[i].args + 1, gc[i].nargs - 1); 822 gc_base[i] = gc_probe(gc_cfg[i].args[0],
823 gc_cfg[i].args + 1, gc_cfg[i].nargs - 1);
823 if (IS_ERR(gc_base[i])) { 824 if (IS_ERR(gc_base[i])) {
824 err = PTR_ERR(gc_base[i]); 825 err = PTR_ERR(gc_base[i]);
825 break; 826 break;