diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2004-10-19 18:10:43 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-19 18:10:43 -0700 |
| commit | 9229204bae3b2928b68351bc3a2c26769ea74047 (patch) | |
| tree | d680f21ea2fce07de9e672511fde3bbeb51447e0 /drivers/input | |
| parent | 1c854f6f64e327b63d3e0814e705ac2c4f5d9052 (diff) | |
[PATCH] module_param_array() should take a pointer
module_param_array() takes a variable to put the number of elements in.
Looking through the uses, many people don't care, so they declare a dummy
or share one variable between several parameters. The latter is
problematic because sysfs uses that number to decide how many to display.
The solution is to change the variable arg to a pointer, and if the pointer
is NULL, use the "max" value. This change is fairly small, but fixing up
the callers is a lot of (trivial) churn.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/joystick/amijoy.c | 3 | ||||
| -rw-r--r-- | drivers/input/joystick/analog.c | 2 | ||||
| -rw-r--r-- | drivers/input/joystick/db9.c | 6 | ||||
| -rw-r--r-- | drivers/input/joystick/gamecon.c | 6 | ||||
| -rw-r--r-- | drivers/input/joystick/turbografx.c | 6 |
5 files changed, 11 insertions, 12 deletions
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c index 8b5fc358d806..cf36ca9b92f3 100644 --- a/drivers/input/joystick/amijoy.c +++ b/drivers/input/joystick/amijoy.c @@ -46,8 +46,7 @@ MODULE_DESCRIPTION("Driver for Amiga joysticks"); MODULE_LICENSE("GPL"); static int amijoy[2] = { 0, 1 }; -static int amijoy_nargs; -module_param_array_named(map, amijoy, uint, amijoy_nargs, 0); +module_param_array_named(map, amijoy, uint, NULL, 0); MODULE_PARM_DESC(map, "Map of attached joysticks in form of <a>,<b> (default is 0,1)"); __obsolete_setup("amijoy="); diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c index 7e52f96096a9..df7b2aadbf86 100644 --- a/drivers/input/joystick/analog.c +++ b/drivers/input/joystick/analog.c @@ -53,7 +53,7 @@ MODULE_LICENSE("GPL"); static char *js[ANALOG_PORTS]; static int js_nargs; static int analog_options[ANALOG_PORTS]; -module_param_array_named(map, js, charp, js_nargs, 0); +module_param_array_named(map, js, charp, &js_nargs, 0); MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities"); __obsolete_setup("js="); diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index 5ad612751c81..c5c6115dc4c5 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c @@ -45,17 +45,17 @@ MODULE_LICENSE("GPL"); static int db9[] __initdata = { -1, 0 }; static int db9_nargs __initdata = 0; -module_param_array_named(dev, db9, int, db9_nargs, 0); +module_param_array_named(dev, db9, int, &db9_nargs, 0); MODULE_PARM_DESC(dev, "Describes first attached device (<parport#>,<type>)"); static int db9_2[] __initdata = { -1, 0 }; static int db9_nargs_2 __initdata = 0; -module_param_array_named(dev2, db9_2, int, db9_nargs_2, 0); +module_param_array_named(dev2, db9_2, int, &db9_nargs_2, 0); MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)"); static int db9_3[] __initdata = { -1, 0 }; static int db9_nargs_3 __initdata = 0; -module_param_array_named(dev3, db9_3, int, db9_nargs_3, 0); +module_param_array_named(dev3, db9_3, int, &db9_nargs_3, 0); MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)"); __obsolete_setup("db9="); diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index 46326b701743..3f2cdb6a32a2 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c @@ -43,17 +43,17 @@ MODULE_LICENSE("GPL"); static int gc[] __initdata = { -1, 0, 0, 0, 0, 0 }; static int gc_nargs __initdata = 0; -module_param_array_named(map, gc, int, gc_nargs, 0); +module_param_array_named(map, gc, int, &gc_nargs, 0); MODULE_PARM_DESC(map, "Describers first set of devices (<parport#>,<pad1>,<pad2>,..<pad5>)"); static int gc_2[] __initdata = { -1, 0, 0, 0, 0, 0 }; static int gc_nargs_2 __initdata = 0; -module_param_array_named(map2, gc_2, int, gc_nargs_2, 0); +module_param_array_named(map2, gc_2, int, &gc_nargs_2, 0); MODULE_PARM_DESC(map2, "Describers second set of devices"); static int gc_3[] __initdata = { -1, 0, 0, 0, 0, 0 }; static int gc_nargs_3 __initdata = 0; -module_param_array_named(map3, gc_3, int, gc_nargs_3, 0); +module_param_array_named(map3, gc_3, int, &gc_nargs_3, 0); MODULE_PARM_DESC(map3, "Describers third set of devices"); __obsolete_setup("gc="); diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index 123ff5f9d42a..0e620cb882cd 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c @@ -44,17 +44,17 @@ MODULE_LICENSE("GPL"); static int tgfx[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 }; static int tgfx_nargs __initdata = 0; -module_param_array_named(map, tgfx, int, tgfx_nargs, 0); +module_param_array_named(map, tgfx, int, &tgfx_nargs, 0); MODULE_PARM_DESC(map, "Describes first set of devices (<parport#>,<js1>,<js2>,..<js7>"); static int tgfx_2[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 }; static int tgfx_nargs_2 __initdata = 0; -module_param_array_named(map2, tgfx_2, int, tgfx_nargs_2, 0); +module_param_array_named(map2, tgfx_2, int, &tgfx_nargs_2, 0); MODULE_PARM_DESC(map2, "Describes second set of devices"); static int tgfx_3[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 }; static int tgfx_nargs_3 __initdata = 0; -module_param_array_named(map3, tgfx_3, int, tgfx_nargs_3, 0); +module_param_array_named(map3, tgfx_3, int, &tgfx_nargs_3, 0); MODULE_PARM_DESC(map3, "Describes third set of devices"); __obsolete_setup("tgfx="); |
