Skip to contentSkip to conversation

small input cleanup

PATCH In review Adrian Bunk 3 participants 6 messages Nov 7, 2004 – Nov 21, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 small input cleanup

The patch below does the following cleanups under drivers/input/ :
- make some needlessly global code static
- remove the completely unused EXPORT_SYMBOL'ed function gameport_rescan
- make the EXPORT_SYMBOL'ed function ps2_sendbyte static since it isn't used outside the file where it's defined

Please review this patch.

In case in-kernel users for the EXPORT_SYMBOL's I've removed are coming soon, simply drop the corresponding parts of the patch.

diffstat output:

 drivers/input/evbug.c               |    4 ++--
 drivers/input/gameport/emu10k1-gp.c |    4 ++--
 drivers/input/gameport/fm801-gp.c   |    4 ++--
 drivers/input/gameport/gameport.c   |    7 -------
 drivers/input/gameport/lightning.c  |    4 ++--
 drivers/input/gameport/ns558.c      |    4 ++--
 drivers/input/gameport/vortex.c     |    4 ++--
 drivers/input/input.c               |    2 +-
 drivers/input/joystick/a3d.c        |   10 +++++-----
 drivers/input/joystick/adi.c        |    4 ++--
 drivers/input/joystick/analog.c     |    6 +++---
 drivers/input/joystick/cobra.c      |    4 ++--
 drivers/input/joystick/db9.c        |    4 ++--
 drivers/input/joystick/gamecon.c    |    4 ++--
 drivers/input/joystick/gf2k.c       |    4 ++--
 drivers/input/joystick/grip.c       |    4 ++--
 drivers/input/joystick/guillemot.c  |    4 ++--
 drivers/input/joystick/interact.c   |    4 ++--
 drivers/input/joystick/magellan.c   |    4 ++--
 drivers/input/joystick/sidewinder.c |    4 ++--
 drivers/input/joystick/spaceball.c  |    4 ++--
 drivers/input/joystick/spaceorb.c   |    4 ++--
 drivers/input/joystick/stinger.c    |    4 ++--
 drivers/input/joystick/tmdc.c       |    4 ++--
 drivers/input/joystick/turbografx.c |    6 +++---
 drivers/input/joystick/warrior.c    |    4 ++--
 drivers/input/keyboard/atkbd.c      |    4 ++--
 drivers/input/keyboard/lkkbd.c      |    4 ++--
 drivers/input/keyboard/newtonkbd.c  |   12 ++++++------
 drivers/input/keyboard/sunkbd.c     |    4 ++--
 drivers/input/keyboard/xtkbd.c      |   12 ++++++------
 drivers/input/misc/pcspkr.c         |    2 +-
 drivers/input/misc/uinput.c         |    2 +-
 drivers/input/mouse/alps.c          |    4 ++--
 drivers/input/mouse/psmouse-base.c  |    4 ++--
 drivers/input/mouse/sermouse.c      |    4 ++--
 drivers/input/mouse/vsxxxaa.c       |    4 ++--
 drivers/input/mousedev.c            |    2 +-
 drivers/input/serio/ct82c710.c      |    4 ++--
 drivers/input/serio/i8042.c         |   10 +++++-----
 drivers/input/serio/libps2.c        |    3 +--
 drivers/input/serio/parkbd.c        |    4 ++--
 drivers/input/serio/serio.c         |    2 +-
 drivers/input/serio/serio_raw.c     |    6 +++---
 drivers/input/touchscreen/gunze.c   |    4 ++--
 drivers/input/tsdev.c               |    2 +-
 include/linux/gameport.h            |    1 -
 include/linux/libps2.h              |    1 -
 48 files changed, 100 insertions(+), 110 deletions(-)
drivers/input/evbug.c renamed from drivers/input/evbug.c.old +2 -2
@@ -88,13 +88,13 @@
 	.id_table =	evbug_ids,
 };
 
-int __init evbug_init(void)
+static int __init evbug_init(void)
 {
 	input_register_handler(&evbug_handler);
 	return 0;
 }
 
-void __exit evbug_exit(void)
+static void __exit evbug_exit(void)
 {
 	input_unregister_handler(&evbug_handler);
 }
drivers/input/gameport/emu10k1-gp.c renamed from drivers/input/gameport/emu10k1-gp.c.old +2 -2
@@ -118,12 +118,12 @@
         .remove =       __devexit_p(emu_remove),
 };
 
-int __init emu_init(void)
+static int __init emu_init(void)
 {
 	return pci_module_init(&emu_driver);
 }
 
-void __exit emu_exit(void)
+static void __exit emu_exit(void)
 {
 	pci_unregister_driver(&emu_driver);
 }
drivers/input/gameport/fm801-gp.c renamed from drivers/input/gameport/fm801-gp.c.old +2 -2
@@ -143,12 +143,12 @@
 	.remove =	__devexit_p(fm801_gp_remove),
 };
 
-int __init fm801_gp_init(void)
+static int __init fm801_gp_init(void)
 {
 	return pci_module_init(&fm801_gp_driver);
 }
 
-void __exit fm801_gp_exit(void)
+static void __exit fm801_gp_exit(void)
 {
 	pci_unregister_driver(&fm801_gp_driver);
 }
include/linux/gameport.h renamed from include/linux/gameport.h.old +0 -1
@@ -53,7 +53,6 @@
 
 int gameport_open(struct gameport *gameport, struct gameport_dev *dev, int mode);
 void gameport_close(struct gameport *gameport);
-void gameport_rescan(struct gameport *gameport);
 
 #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
 void gameport_register_port(struct gameport *gameport);
drivers/input/gameport/gameport.c renamed from drivers/input/gameport/gameport.c.old +0 -7
@@ -29,7 +29,6 @@
 EXPORT_SYMBOL(gameport_unregister_device);
 EXPORT_SYMBOL(gameport_open);
 EXPORT_SYMBOL(gameport_close);
-EXPORT_SYMBOL(gameport_rescan);
 EXPORT_SYMBOL(gameport_cooked_read);
 
 static LIST_HEAD(gameport_list);
@@ -112,12 +111,6 @@
         }
 }
 
-void gameport_rescan(struct gameport *gameport)
-{
-	gameport_close(gameport);
-	gameport_find_dev(gameport);
-}
-
 void gameport_register_port(struct gameport *gameport)
 {
 	list_add_tail(&gameport->node, &gameport_list);
drivers/input/gameport/lightning.c renamed from drivers/input/gameport/lightning.c.old +2 -2
@@ -53,13 +53,13 @@
 MODULE_DESCRIPTION("PDPI Lightning 4 gamecard driver");
 MODULE_LICENSE("GPL");
 
-struct l4 {
+static struct l4 {
 	struct gameport gameport;
 	unsigned char port;
 	char phys[32];
 } *l4_port[8];
 
-char l4_name[] = "PDPI Lightning 4";
+static char l4_name[] = "PDPI Lightning 4";
 
 /*
  * l4_wait_ready() waits for the L4 to become ready.
drivers/input/gameport/ns558.c renamed from drivers/input/gameport/ns558.c.old +2 -2
@@ -261,7 +261,7 @@
 
 #endif
 
-int __init ns558_init(void)
+static int __init ns558_init(void)
 {
 	int i = 0;
 
@@ -276,7 +276,7 @@
 	return list_empty(&ns558_list) ? -ENODEV : 0;
 }
 
-void __exit ns558_exit(void)
+static void __exit ns558_exit(void)
 {
 	struct ns558 *port;
 
drivers/input/gameport/vortex.c renamed from drivers/input/gameport/vortex.c.old +2 -2
@@ -172,12 +172,12 @@
 	.remove =	__devexit_p(vortex_remove),
 };
 
-int __init vortex_init(void)
+static int __init vortex_init(void)
 {
 	return pci_module_init(&vortex_driver);
 }
 
-void __exit vortex_exit(void)
+static void __exit vortex_exit(void)
 {
 	pci_unregister_driver(&vortex_driver);
 }
drivers/input/input.c renamed from drivers/input/input.c.old +1 -1
@@ -50,7 +50,7 @@
 
 #ifdef CONFIG_PROC_FS
 static struct proc_dir_entry *proc_bus_input_dir;
-DECLARE_WAIT_QUEUE_HEAD(input_devices_poll_wait);
+static DECLARE_WAIT_QUEUE_HEAD(input_devices_poll_wait);
 static int input_devices_state;
 #endif
 
drivers/input/joystick/a3d.c renamed from drivers/input/joystick/a3d.c.old +5 -5
@@ -50,7 +50,7 @@
 #define A3D_MODE_OEM		3	/* Panther OEM version */
 #define A3D_MODE_PXL		4	/* Panther XL */
 
-char *a3d_names[] = { NULL, "FP-Gaming Assassin 3D", "MadCatz Panther", "OEM Panther",
+static char *a3d_names[] = { NULL, "FP-Gaming Assassin 3D", "MadCatz Panther", "OEM Panther",
 			"MadCatz Panther XL", "MadCatz Panther XL w/ rudder" };
 
 struct a3d {
@@ -195,7 +195,7 @@
  * call this more than 50 times a second, which would use too much CPU.
  */
 
-int a3d_adc_cooked_read(struct gameport *gameport, int *axes, int *buttons)
+static int a3d_adc_cooked_read(struct gameport *gameport, int *axes, int *buttons)
 {
 	struct a3d *a3d = gameport->driver;
 	int i;
@@ -210,7 +210,7 @@
  * any but cooked data.
  */
 
-int a3d_adc_open(struct gameport *gameport, int mode)
+static int a3d_adc_open(struct gameport *gameport, int mode)
 {
 	struct a3d *a3d = gameport->driver;
 	if (mode != GAMEPORT_MODE_COOKED)
@@ -390,13 +390,13 @@
 	.disconnect =	a3d_disconnect,
 };
 
-int __init a3d_init(void)
+static int __init a3d_init(void)
 {
 	gameport_register_device(&a3d_dev);
 	return 0;
 }
 
-void __exit a3d_exit(void)
+static void __exit a3d_exit(void)
 {
 	gameport_unregister_device(&a3d_dev);
 }
drivers/input/joystick/adi.c renamed from drivers/input/joystick/adi.c.old +2 -2
@@ -549,13 +549,13 @@
 	.disconnect =	adi_disconnect,
 };
 
-int __init adi_init(void)
+static int __init adi_init(void)
 {
 	gameport_register_device(&adi_dev);
 	return 0;
 }
 
-void __exit adi_exit(void)
+static void __exit adi_exit(void)
 {
 	gameport_unregister_device(&adi_dev);
 }
drivers/input/joystick/analog.c renamed from drivers/input/joystick/analog.c.old +3 -3
@@ -696,7 +696,7 @@
 	int value;
 };
 
-struct analog_types analog_types[] = {
+static struct analog_types analog_types[] = {
 	{ "none",	0x00000000 },
 	{ "auto",	0x000000ff },
 	{ "2btn",	0x0000003f },
@@ -746,14 +746,14 @@
 	.disconnect =	analog_disconnect,
 };
 
-int __init analog_init(void)
+static int __init analog_init(void)
 {
 	analog_parse_options();
 	gameport_register_device(&analog_dev);
 	return 0;
 }
 
-void __exit analog_exit(void)
+static void __exit analog_exit(void)
 {
 	gameport_unregister_device(&analog_dev);
 }
drivers/input/joystick/cobra.c renamed from drivers/input/joystick/cobra.c.old +2 -2
@@ -241,13 +241,13 @@
 	.disconnect =	cobra_disconnect,
 };
 
-int __init cobra_init(void)
+static int __init cobra_init(void)
 {
 	gameport_register_device(&cobra_dev);
 	return 0;
 }
 
-void __exit cobra_exit(void)
+static void __exit cobra_exit(void)
 {
 	gameport_unregister_device(&cobra_dev);
 }
drivers/input/joystick/db9.c renamed from drivers/input/joystick/db9.c.old +2 -2
@@ -619,7 +619,7 @@
 	return db9;
 }
 
-int __init db9_init(void)
+static int __init db9_init(void)
 {
 	db9_base[0] = db9_probe(db9, db9_nargs);
 	db9_base[1] = db9_probe(db9_2, db9_nargs_2);
@@ -631,7 +631,7 @@
 	return -ENODEV;
 }
 
-void __exit db9_exit(void)
+static void __exit db9_exit(void)
 {
 	int i, j;
 
drivers/input/joystick/gamecon.c renamed from drivers/input/joystick/gamecon.c.old +2 -2
@@ -665,7 +665,7 @@
 	return gc;
 }
 
-int __init gc_init(void)
+static int __init gc_init(void)
 {
 	gc_base[0] = gc_probe(gc, gc_nargs);
 	gc_base[1] = gc_probe(gc_2, gc_nargs_2);
@@ -677,7 +677,7 @@
 	return -ENODEV;
 }
 
-void __exit gc_exit(void)
+static void __exit gc_exit(void)
 {
 	int i, j;
 
drivers/input/joystick/gf2k.c renamed from drivers/input/joystick/gf2k.c.old +2 -2
@@ -351,13 +351,13 @@
 	.disconnect =	gf2k_disconnect,
 };
 
-int __init gf2k_init(void)
+static int __init gf2k_init(void)
 {
 	gameport_register_device(&gf2k_dev);
 	return 0;
 }
 
-void __exit gf2k_exit(void)
+static void __exit gf2k_exit(void)
 {
 	gameport_unregister_device(&gf2k_dev);
 }
drivers/input/joystick/grip.c renamed from drivers/input/joystick/grip.c.old +2 -2
@@ -414,13 +414,13 @@
 	.disconnect =	grip_disconnect,
 };
 
-int __init grip_init(void)
+static int __init grip_init(void)
 {
 	gameport_register_device(&grip_dev);
 	return 0;
 }
 
-void __exit grip_exit(void)
+static void __exit grip_exit(void)
 {
 	gameport_unregister_device(&grip_dev);
 }
drivers/input/joystick/guillemot.c renamed from drivers/input/joystick/guillemot.c.old +2 -2
@@ -271,13 +271,13 @@
 	.disconnect =	guillemot_disconnect,
 };
 
-int __init guillemot_init(void)
+static int __init guillemot_init(void)
 {
 	gameport_register_device(&guillemot_dev);
 	return 0;
 }
 
-void __exit guillemot_exit(void)
+static void __exit guillemot_exit(void)
 {
 	gameport_unregister_device(&guillemot_dev);
 }
drivers/input/joystick/interact.c renamed from drivers/input/joystick/interact.c.old +2 -2
@@ -299,13 +299,13 @@
 	.disconnect =	interact_disconnect,
 };
 
-int __init interact_init(void)
+static int __init interact_init(void)
 {
 	gameport_register_device(&interact_dev);
 	return 0;
 }
 
-void __exit interact_exit(void)
+static void __exit interact_exit(void)
 {
 	gameport_unregister_device(&interact_dev);
 }
drivers/input/joystick/magellan.c renamed from drivers/input/joystick/magellan.c.old +2 -2
@@ -216,13 +216,13 @@
  * The functions for inserting/removing us as a module.
  */
 
-int __init magellan_init(void)
+static int __init magellan_init(void)
 {
 	serio_register_driver(&magellan_drv);
 	return 0;
 }
 
-void __exit magellan_exit(void)
+static void __exit magellan_exit(void)
 {
 	serio_unregister_driver(&magellan_drv);
 }
drivers/input/joystick/sidewinder.c renamed from drivers/input/joystick/sidewinder.c.old +2 -2
@@ -765,13 +765,13 @@
 	.disconnect =	sw_disconnect,
 };
 
-int __init sw_init(void)
+static int __init sw_init(void)
 {
 	gameport_register_device(&sw_dev);
 	return 0;
 }
 
-void __exit sw_exit(void)
+static void __exit sw_exit(void)
 {
 	gameport_unregister_device(&sw_dev);
 }
drivers/input/joystick/spaceball.c renamed from drivers/input/joystick/spaceball.c.old +2 -2
@@ -286,13 +286,13 @@
  * The functions for inserting/removing us as a module.
  */
 
-int __init spaceball_init(void)
+static int __init spaceball_init(void)
 {
 	serio_register_driver(&spaceball_drv);
 	return 0;
 }
 
-void __exit spaceball_exit(void)
+static void __exit spaceball_exit(void)
 {
 	serio_unregister_driver(&spaceball_drv);
 }
drivers/input/joystick/spaceorb.c renamed from drivers/input/joystick/spaceorb.c.old +2 -2
@@ -230,13 +230,13 @@
  * The functions for inserting/removing us as a module.
  */
 
-int __init spaceorb_init(void)
+static int __init spaceorb_init(void)
 {
 	serio_register_driver(&spaceorb_drv);
 	return 0;
 }
 
-void __exit spaceorb_exit(void)
+static void __exit spaceorb_exit(void)
 {
 	serio_unregister_driver(&spaceorb_drv);
 }
drivers/input/joystick/stinger.c renamed from drivers/input/joystick/stinger.c.old +2 -2
@@ -204,13 +204,13 @@
  * The functions for inserting/removing us as a module.
  */
 
-int __init stinger_init(void)
+static int __init stinger_init(void)
 {
 	serio_register_driver(&stinger_drv);
 	return 0;
 }
 
-void __exit stinger_exit(void)
+static void __exit stinger_exit(void)
 {
 	serio_unregister_driver(&stinger_drv);
 }
drivers/input/joystick/tmdc.c renamed from drivers/input/joystick/tmdc.c.old +2 -2
@@ -367,13 +367,13 @@
 	.disconnect =	tmdc_disconnect,
 };
 
-int __init tmdc_init(void)
+static int __init tmdc_init(void)
 {
 	gameport_register_device(&tmdc_dev);
 	return 0;
 }
 
-void __exit tmdc_exit(void)
+static void __exit tmdc_exit(void)
 {
 	gameport_unregister_device(&tmdc_dev);
 }
drivers/input/joystick/turbografx.c renamed from drivers/input/joystick/turbografx.c.old +3 -3
@@ -77,7 +77,7 @@
 static int tgfx_buttons[] = { BTN_TRIGGER, BTN_THUMB, BTN_THUMB2, BTN_TOP, BTN_TOP2 };
 static char *tgfx_name = "TurboGraFX Multisystem joystick";
 
-struct tgfx {
+static struct tgfx {
 	struct pardevice *pd;
 	struct timer_list timer;
 	struct input_dev dev[7];
@@ -229,7 +229,7 @@
 	return tgfx;
 }
 
-int __init tgfx_init(void)
+static int __init tgfx_init(void)
 {
 	tgfx_base[0] = tgfx_probe(tgfx, tgfx_nargs);
 	tgfx_base[1] = tgfx_probe(tgfx_2, tgfx_nargs_2);
@@ -241,7 +241,7 @@
 	return -ENODEV;
 }
 
-void __exit tgfx_exit(void)
+static void __exit tgfx_exit(void)
 {
 	int i, j;
 
drivers/input/joystick/warrior.c renamed from drivers/input/joystick/warrior.c.old +2 -2
@@ -216,13 +216,13 @@
  * The functions for inserting/removing us as a module.
  */
 
-int __init warrior_init(void)
+static int __init warrior_init(void)
 {
 	serio_register_driver(&warrior_drv);
 	return 0;
 }
 
-void __exit warrior_exit(void)
+static void __exit warrior_exit(void)
 {
 	serio_unregister_driver(&warrior_drv);
 }
drivers/input/keyboard/atkbd.c renamed from drivers/input/keyboard/atkbd.c.old +2 -2
@@ -1096,13 +1096,13 @@
 }
 
 
-int __init atkbd_init(void)
+static int __init atkbd_init(void)
 {
 	serio_register_driver(&atkbd_drv);
 	return 0;
 }
 
-void __exit atkbd_exit(void)
+static void __exit atkbd_exit(void)
 {
 	serio_unregister_driver(&atkbd_drv);
 }
drivers/input/keyboard/lkkbd.c renamed from drivers/input/keyboard/lkkbd.c.old +2 -2
@@ -719,14 +719,14 @@
 /*
  * The functions for insering/removing us as a module.
  */
-int __init
+static int __init
 lkkbd_init (void)
 {
 	serio_register_driver(&lkkbd_drv);
 	return 0;
 }
 
-void __exit
+static void __exit
 lkkbd_exit (void)
 {
 	serio_unregister_driver(&lkkbd_drv);
drivers/input/keyboard/newtonkbd.c renamed from drivers/input/keyboard/newtonkbd.c.old +6 -6
@@ -66,7 +66,7 @@
 	char phys[32];
 };
 
-irqreturn_t nkbd_interrupt(struct serio *serio,
+static irqreturn_t nkbd_interrupt(struct serio *serio,
 		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct nkbd *nkbd = serio->private;
@@ -84,7 +84,7 @@
 
 }
 
-void nkbd_connect(struct serio *serio, struct serio_driver *drv)
+static void nkbd_connect(struct serio *serio, struct serio_driver *drv)
 {
 	struct nkbd *nkbd;
 	int i;
@@ -133,7 +133,7 @@
 	printk(KERN_INFO "input: %s on %s\n", nkbd_name, serio->phys);
 }
 
-void nkbd_disconnect(struct serio *serio)
+static void nkbd_disconnect(struct serio *serio)
 {
 	struct nkbd *nkbd = serio->private;
 	input_unregister_device(&nkbd->dev);
@@ -141,7 +141,7 @@
 	kfree(nkbd);
 }
 
-struct serio_driver nkbd_drv = {
+static struct serio_driver nkbd_drv = {
 	.driver		= {
 		.name	= "newtonkbd",
 	},
@@ -151,13 +151,13 @@
 	.disconnect	= nkbd_disconnect,
 };
 
-int __init nkbd_init(void)
+static int __init nkbd_init(void)
 {
 	serio_register_driver(&nkbd_drv);
 	return 0;
 }
 
-void __exit nkbd_exit(void)
+static void __exit nkbd_exit(void)
 {
 	serio_unregister_driver(&nkbd_drv);
 }
drivers/input/keyboard/sunkbd.c renamed from drivers/input/keyboard/sunkbd.c.old +2 -2
@@ -318,13 +318,13 @@
  * The functions for insering/removing us as a module.
  */
 
-int __init sunkbd_init(void)
+static int __init sunkbd_init(void)
 {
 	serio_register_driver(&sunkbd_drv);
 	return 0;
 }
 
-void __exit sunkbd_exit(void)
+static void __exit sunkbd_exit(void)
 {
 	serio_unregister_driver(&sunkbd_drv);
 }
drivers/input/keyboard/xtkbd.c renamed from drivers/input/keyboard/xtkbd.c.old +6 -6
@@ -65,7 +65,7 @@
 	char phys[32];
 };
 
-irqreturn_t xtkbd_interrupt(struct serio *serio,
+static irqreturn_t xtkbd_interrupt(struct serio *serio,
 	unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct xtkbd *xtkbd = serio->private;
@@ -88,7 +88,7 @@
 	return IRQ_HANDLED;
 }
 
-void xtkbd_connect(struct serio *serio, struct serio_driver *drv)
+static void xtkbd_connect(struct serio *serio, struct serio_driver *drv)
 {
 	struct xtkbd *xtkbd;
 	int i;
@@ -138,7 +138,7 @@
 	printk(KERN_INFO "input: %s on %s\n", xtkbd_name, serio->phys);
 }
 
-void xtkbd_disconnect(struct serio *serio)
+static void xtkbd_disconnect(struct serio *serio)
 {
 	struct xtkbd *xtkbd = serio->private;
 	input_unregister_device(&xtkbd->dev);
@@ -146,7 +146,7 @@
 	kfree(xtkbd);
 }
 
-struct serio_driver xtkbd_drv = {
+static struct serio_driver xtkbd_drv = {
 	.driver		= {
 		.name	= "xtkbd",
 	},
@@ -156,13 +156,13 @@
 	.disconnect	= xtkbd_disconnect,
 };
 
-int __init xtkbd_init(void)
+static int __init xtkbd_init(void)
 {
 	serio_register_driver(&xtkbd_drv);
 	return 0;
 }
 
-void __exit xtkbd_exit(void)
+static void __exit xtkbd_exit(void)
 {
 	serio_unregister_driver(&xtkbd_drv);
 }
drivers/input/misc/pcspkr.c renamed from drivers/input/misc/pcspkr.c.old +1 -1
@@ -27,7 +27,7 @@
 static char pcspkr_phys[] = "isa0061/input0";
 static struct input_dev pcspkr_dev;
 
-spinlock_t i8253_beep_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t i8253_beep_lock = SPIN_LOCK_UNLOCKED;
 
 static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
drivers/input/misc/uinput.c renamed from drivers/input/misc/uinput.c.old +1 -1
@@ -396,7 +396,7 @@
 	return retval;
 }
 
-struct file_operations uinput_fops = {
+static struct file_operations uinput_fops = {
 	.owner =	THIS_MODULE,
 	.open =		uinput_open,
 	.release =	uinput_close,
drivers/input/mouse/alps.c renamed from drivers/input/mouse/alps.c.old +2 -2
@@ -30,7 +30,7 @@
 #define ALPS_MODEL_GLIDEPOINT	1
 #define ALPS_MODEL_DUALPOINT	2
 
-struct alps_model_info {
+static struct alps_model_info {
 	unsigned char signature[3];
 	unsigned char model;
 } alps_model_data[] = {
@@ -187,7 +187,7 @@
 	return PSMOUSE_GOOD_DATA;
 }
 
-int alps_get_model(struct psmouse *psmouse)
+static int alps_get_model(struct psmouse *psmouse)
 {
 	struct ps2dev *ps2dev = &psmouse->ps2dev;
 	unsigned char param[4];
drivers/input/mouse/psmouse-base.c renamed from drivers/input/mouse/psmouse-base.c.old +2 -2
@@ -954,14 +954,14 @@
 	}
 }
 
-int __init psmouse_init(void)
+static int __init psmouse_init(void)
 {
 	psmouse_parse_proto();
 	serio_register_driver(&psmouse_drv);
 	return 0;
 }
 
-void __exit psmouse_exit(void)
+static void __exit psmouse_exit(void)
 {
 	serio_unregister_driver(&psmouse_drv);
 }
drivers/input/mouse/sermouse.c renamed from drivers/input/mouse/sermouse.c.old +2 -2
@@ -302,13 +302,13 @@
 	.disconnect	= sermouse_disconnect,
 };
 
-int __init sermouse_init(void)
+static int __init sermouse_init(void)
 {
 	serio_register_driver(&sermouse_drv);
 	return 0;
 }
 
-void __exit sermouse_exit(void)
+static void __exit sermouse_exit(void)
 {
 	serio_unregister_driver(&sermouse_drv);
 }
drivers/input/mouse/vsxxxaa.c renamed from drivers/input/mouse/vsxxxaa.c.old +2 -2
@@ -558,14 +558,14 @@
 	.disconnect	= vsxxxaa_disconnect,
 };
 
-int __init
+static int __init
 vsxxxaa_init (void)
 {
 	serio_register_driver(&vsxxxaa_drv);
 	return 0;
 }
 
-void __exit
+static void __exit
 vsxxxaa_exit (void)
 {
 	serio_unregister_driver(&vsxxxaa_drv);
drivers/input/mousedev.c renamed from drivers/input/mousedev.c.old +1 -1
@@ -590,7 +590,7 @@
 	return 0;
 }
 
-struct file_operations mousedev_fops = {
+static struct file_operations mousedev_fops = {
 	.owner =	THIS_MODULE,
 	.read =		mousedev_read,
 	.write =	mousedev_write,
drivers/input/serio/ct82c710.c renamed from drivers/input/serio/ct82c710.c.old +2 -2
@@ -193,7 +193,7 @@
 	return serio;
 }
 
-int __init ct82c710_init(void)
+static int __init ct82c710_init(void)
 {
 	if (ct82c710_probe())
 		return -ENODEV;
@@ -215,7 +215,7 @@
 	return 0;
 }
 
-void __exit ct82c710_exit(void)
+static void __exit ct82c710_exit(void)
 {
 	serio_unregister_port(ct82c710_port);
 	platform_device_unregister(ct82c710_device);
drivers/input/serio/i8042.c renamed from drivers/input/serio/i8042.c.old +5 -5
@@ -77,7 +77,7 @@
 
 #include "i8042.h"
 
-spinlock_t i8042_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t i8042_lock = SPIN_LOCK_UNLOCKED;
 
 struct i8042_values {
 	int irq;
@@ -845,7 +845,7 @@
 /*
  * Reset the controller.
  */
-void i8042_controller_reset(void)
+static void i8042_controller_reset(void)
 {
 	if (i8042_reset) {
 		unsigned char param;
@@ -870,7 +870,7 @@
  * able to talk to the hardware when rebooting.
  */
 
-void i8042_controller_cleanup(void)
+static void i8042_controller_cleanup(void)
 {
 	int i;
 
@@ -1073,7 +1073,7 @@
 	return serio;
 }
 
-int __init i8042_init(void)
+static int __init i8042_init(void)
 {
 	int i;
 	int err;
@@ -1125,7 +1125,7 @@
 	return 0;
 }
 
-void __exit i8042_exit(void)
+static void __exit i8042_exit(void)
 {
 	int i;
 
include/linux/libps2.h renamed from include/linux/libps2.h.old +0 -1
@@ -40,7 +40,6 @@
 };
 
 void ps2_init(struct ps2dev *ps2dev, struct serio *serio);
-int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout);
 int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
 int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command);
 int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data);
drivers/input/serio/libps2.c renamed from drivers/input/serio/libps2.c.old +1 -2
@@ -28,7 +28,6 @@
 MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(ps2_init);
-EXPORT_SYMBOL(ps2_sendbyte);
 EXPORT_SYMBOL(ps2_command);
 EXPORT_SYMBOL(ps2_schedule_command);
 EXPORT_SYMBOL(ps2_handle_ack);
@@ -52,7 +51,7 @@
  * ps2_sendbyte() can only be called from a process context
  */
 
-int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout)
+static int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout)
 {
 	serio_pause_rx(ps2dev->serio);
 	ps2dev->nak = 1;
drivers/input/serio/parkbd.c renamed from drivers/input/serio/parkbd.c.old +2 -2
@@ -167,7 +167,7 @@
 	return serio;
 }
 
-int __init parkbd_init(void)
+static int __init parkbd_init(void)
 {
 	int err;
 
@@ -191,7 +191,7 @@
 	return 0;
 }
 
-void __exit parkbd_exit(void)
+static void __exit parkbd_exit(void)
 {
 	parport_release(parkbd_dev);
 	serio_unregister_port(parkbd_port);
drivers/input/serio/serio.c renamed from drivers/input/serio/serio.c.old +1 -1
@@ -58,7 +58,7 @@
 static LIST_HEAD(serio_driver_list);
 static unsigned int serio_no;
 
-struct bus_type serio_bus = {
+static struct bus_type serio_bus = {
 	.name =	"serio",
 };
 
drivers/input/serio/serio_raw.c renamed from drivers/input/serio/serio_raw.c.old +3 -3
@@ -235,7 +235,7 @@
 	return 0;
 }
 
-struct file_operations serio_raw_fops = {
+static struct file_operations serio_raw_fops = {
 	.owner =	THIS_MODULE,
 	.open =		serio_raw_open,
 	.release =	serio_raw_release,
@@ -375,13 +375,13 @@
 	.manual_bind	= 1,
 };
 
-int __init serio_raw_init(void)
+static int __init serio_raw_init(void)
 {
 	serio_register_driver(&serio_raw_drv);
 	return 0;
 }
 
-void __exit serio_raw_exit(void)
+static void __exit serio_raw_exit(void)
 {
 	serio_unregister_driver(&serio_raw_drv);
 }
drivers/input/touchscreen/gunze.c renamed from drivers/input/touchscreen/gunze.c.old +2 -2
@@ -172,13 +172,13 @@
  * The functions for inserting/removing us as a module.
  */
 
-int __init gunze_init(void)
+static int __init gunze_init(void)
 {
 	serio_register_driver(&gunze_drv);
 	return 0;
 }
 
-void __exit gunze_exit(void)
+static void __exit gunze_exit(void)
 {
 	serio_unregister_driver(&gunze_drv);
 }
drivers/input/tsdev.c renamed from drivers/input/tsdev.c.old +1 -1
@@ -265,7 +265,7 @@
 	return retval;
 }
 
-struct file_operations tsdev_fops = {
+static struct file_operations tsdev_fops = {
 	.owner =	THIS_MODULE,
 	.open =		tsdev_open,
 	.release =	tsdev_release,
#1 lore raw

Hi,

Quoted 3 lines · Adrian Bunk

The patch below does the following cleanups under drivers/input/ :
- make some needlessly global code static
- remove the completely unused EXPORT_SYMBOL'ed function gameport_rescan

It will be used (but in some transformed) once I finish gameport sysfs support, but it probably need not be exported.

Quoted 2 lines

- make the EXPORT_SYMBOL'ed function ps2_sendbyte static since it isn't used outside the file where it's defined

libps2 is a library for communicating with standard PS/2 device and while the function is not currently used it is part of the interface. I would like to leave the function as is.

Signature · 1 line
Dmitry
#2 lore raw
Quoted 1 line · Dmitry Torokhov

Hi,

Hi Dmitry,

Quoted 8 lines · Adrian Bunk
Quoted 3 lines

The patch below does the following cleanups under drivers/input/ :
- make some needlessly global code static
- remove the completely unused EXPORT_SYMBOL'ed function gameport_rescan

It will be used (but in some transformed) once I finish gameport sysfs support, but it probably need not be exported.

Quoted 6 lines
Quoted 2 lines

- make the EXPORT_SYMBOL'ed function ps2_sendbyte static since it isn't used outside the file where it's defined

libps2 is a library for communicating with standard PS/2 device and while the function is not currently used it is part of the interface. I would like to leave the function as is.

my personal opinions:
- if gameport_rescan will not be needed in it's current form, there's no need for it (you can always add the "real" function when it's required
- could ps2_sendbyte be #ifdef 0'ed until it's required? this way, it wouldn't make the kernel bigger today

Quoted 1 line

Dmitry

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 17 lines · Adrian Bunk
Quoted 1 line · Dmitry Torokhov

Hi,

Hi Dmitry,

Quoted 11 lines · Adrian Bunk
Quoted 3 lines

The patch below does the following cleanups under drivers/input/ :
- make some needlessly global code static
- remove the completely unused EXPORT_SYMBOL'ed function gameport_rescan

It will be used (but in some transformed) once I finish gameport sysfs support, but it probably need not be exported.

Quoted 2 lines

- make the EXPORT_SYMBOL'ed function ps2_sendbyte static since it isn't used outside the file where it's defined

Quoted 8 lines
Quoted 3 lines

libps2 is a library for communicating with standard PS/2 device and while the function is not currently used it is part of the interface. I would like to leave the function as is.

my personal opinions:
- if gameport_rescan will not be needed in it's current form, there's no need for it (you can always add the "real" function when it's required

Well, it works in its current form, and drivers should call it when their reinit logic fails to reinitialize the device. They don't, which is a bug, and should be fixed. I don't think removing gameport_rescan() will help fixing them.

Quoted 2 lines

- could ps2_sendbyte be #ifdef 0'ed until it's required? this way, it wouldn't make the kernel bigger today

It is used, just not outside libps2. Does the EXPORT_SYMBOL() make the kernel so much bigger?

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#4 lore raw
Quoted 27 lines · Vojtech Pavlik
Quoted 17 lines · Adrian Bunk
Quoted 1 line · Dmitry Torokhov

Hi,

Hi Dmitry,

Quoted 11 lines · Adrian Bunk
Quoted 3 lines

The patch below does the following cleanups under drivers/input/ :
- make some needlessly global code static
- remove the completely unused EXPORT_SYMBOL'ed function gameport_rescan

It will be used (but in some transformed) once I finish gameport sysfs support, but it probably need not be exported.

Quoted 2 lines

- make the EXPORT_SYMBOL'ed function ps2_sendbyte static since it isn't used outside the file where it's defined

Quoted 8 lines
Quoted 3 lines

libps2 is a library for communicating with standard PS/2 device and while the function is not currently used it is part of the interface. I would like to leave the function as is.

my personal opinions:
- if gameport_rescan will not be needed in it's current form, there's no need for it (you can always add the "real" function when it's required

Quoted 4 lines

Well, it works in its current form, and drivers should call it when their reinit logic fails to reinitialize the device. They don't, which is a bug, and should be fixed. I don't think removing gameport_rescan() will help fixing them.

Fine with me.

Quoted 5 lines
Quoted 2 lines

- could ps2_sendbyte be #ifdef 0'ed until it's required? this way, it wouldn't make the kernel bigger today

It is used, just not outside libps2. Does the EXPORT_SYMBOL() make the kernel so much bigger?

It doesn't make a big difference, but if an EXPORT_SYMBOL isn't required (and won't be required in the near future), where's the point keeping it?

The situation is clearly different if in-kernel users from other files will be added in the near future.

Quoted 1 line

Vojtech Pavlik

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#5 lore raw
Quoted 13 lines · Adrian Bunk
Quoted 4 lines

Well, it works in its current form, and drivers should call it when their reinit logic fails to reinitialize the device. They don't, which is a bug, and should be fixed. I don't think removing gameport_rescan() will help fixing them.

Fine with me.

Quoted 5 lines
Quoted 2 lines

- could ps2_sendbyte be #ifdef 0'ed until it's required? this way, it wouldn't make the kernel bigger today

It is used, just not outside libps2. Does the EXPORT_SYMBOL() make the kernel so much bigger?

Quoted 6 lines

It doesn't make a big difference, but if an EXPORT_SYMBOL isn't required (and won't be required in the near future), where's the point keeping it?

The situation is clearly different if in-kernel users from other files will be added in the near future.

So far all devices only need proper commands per PS/2 specification. The export is there in case some device will need to be sent separate bytes outside the command structure.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR