Skip to contentSkip to conversation

drivers/input/: possible cleanups

PATCH In review Adrian Bunk 2 participants 6 messages Nov 4, 2005 – Nov 5, 2005 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/input/: possible cleanups

This patch contains the following possible cleanups:
- make needlessly glbal code static
- gameport/gameport: #if 0 the unused global function gameport_reconnect

---

 drivers/input/gameport/gameport.c |    2 ++
 drivers/input/joystick/twidjoy.c  |    4 ++--
 drivers/input/touchscreen/mk712.c |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/input/joystick/twidjoy.c renamed from drivers/input/joystick/twidjoy.c.old +2 -2
@@ -265,13 +265,13 @@
  * The functions for inserting/removing us as a module.
  */
 
-int __init twidjoy_init(void)
+static int __init twidjoy_init(void)
 {
 	serio_register_driver(&twidjoy_drv);
 	return 0;
 }
 
-void __exit twidjoy_exit(void)
+static void __exit twidjoy_exit(void)
 {
 	serio_unregister_driver(&twidjoy_drv);
 }
drivers/input/touchscreen/mk712.c renamed from drivers/input/touchscreen/mk712.c.old +1 -1
@@ -154,7 +154,7 @@
 	spin_unlock_irqrestore(&mk712_lock, flags);
 }
 
-int __init mk712_init(void)
+static int __init mk712_init(void)
 {
 	int err;
 
drivers/input/gameport/gameport.c renamed from drivers/input/gameport/gameport.c.old +2 -0
@@ -637,10 +637,12 @@
 	gameport_queue_event(gameport, NULL, GAMEPORT_RESCAN);
 }
 
+#if 0
 void gameport_reconnect(struct gameport *gameport)
 {
 	gameport_queue_event(gameport, NULL, GAMEPORT_RECONNECT);
 }
+#endif  /*  0  */
 
 /*
  * Submits register request to kgameportd for subsequent execution.
#1 lore raw
Quoted 2 lines · Adrian Bunk

This patch contains the following possible cleanups:
- make needlessly glbal code static

Agreed.

Quoted 1 line

- gameport/gameport: #if 0 the unused global function gameport_reconnect

That one should be an EXPORT_SYMBOL() API. If the export is missing, then that's the bug that needs to be fixed.

Quoted 57 lines

---

 drivers/input/gameport/gameport.c |    2 ++
 drivers/input/joystick/twidjoy.c  |    4 ++--
 drivers/input/touchscreen/mk712.c |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/input/joystick/twidjoy.c renamed from drivers/input/joystick/twidjoy.c.old +2 -2
@@ -265,13 +265,13 @@
  * The functions for inserting/removing us as a module.
  */
 
-int __init twidjoy_init(void)
+static int __init twidjoy_init(void)
 {
 	serio_register_driver(&twidjoy_drv);
 	return 0;
 }
 
-void __exit twidjoy_exit(void)
+static void __exit twidjoy_exit(void)
 {
 	serio_unregister_driver(&twidjoy_drv);
 }
drivers/input/touchscreen/mk712.c renamed from drivers/input/touchscreen/mk712.c.old +1 -1
@@ -154,7 +154,7 @@
 	spin_unlock_irqrestore(&mk712_lock, flags);
 }
 
-int __init mk712_init(void)
+static int __init mk712_init(void)
 {
 	int err;
 
drivers/input/gameport/gameport.c renamed from drivers/input/gameport/gameport.c.old +2 -0
@@ -637,10 +637,12 @@
 	gameport_queue_event(gameport, NULL, GAMEPORT_RESCAN);
 }
 
+#if 0
 void gameport_reconnect(struct gameport *gameport)
 {
 	gameport_queue_event(gameport, NULL, GAMEPORT_RECONNECT);
 }
+#endif  /*  0  */
 
 /*
  * Submits register request to kgameportd for subsequent execution.
Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#2 lore raw
Quoted 11 lines · Vojtech Pavlik
Quoted 2 lines · Adrian Bunk

This patch contains the following possible cleanups:
- make needlessly glbal code static

Agreed.

Quoted 1 line

- gameport/gameport: #if 0 the unused global function gameport_reconnect

That one should be an EXPORT_SYMBOL() API. If the export is missing, then that's the bug that needs to be fixed.
...

There isn't even a header providing a function prototype which is quite strange for a part of an API.

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
#3 lore raw
Quoted 7 lines · Adrian Bunk
Quoted 6 lines · Vojtech Pavlik
Quoted 2 lines · Adrian Bunk

This patch contains the following possible cleanups:
- make needlessly glbal code static

Agreed.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

- gameport/gameport: #if 0 the unused global function gameport_reconnect

That one should be an EXPORT_SYMBOL() API. If the export is missing, then that's the bug that needs to be fixed.
...

There isn't even a header providing a function prototype which is quite strange for a part of an API.

It's a planned API (a mirror of what the serio abstraction does), the drivers don't use it yet.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#4 lore raw
Quoted 15 lines · Vojtech Pavlik
Quoted 13 lines · Adrian Bunk
Quoted 11 lines · Vojtech Pavlik
Quoted 2 lines · Adrian Bunk

This patch contains the following possible cleanups:
- make needlessly glbal code static

Agreed.

Quoted 1 line

- gameport/gameport: #if 0 the unused global function gameport_reconnect

That one should be an EXPORT_SYMBOL() API. If the export is missing, then that's the bug that needs to be fixed.
...

Quoted 5 lines
Quoted 2 lines

There isn't even a header providing a function prototype which is quite strange for a part of an API.

It's a planned API (a mirror of what the serio abstraction does), the drivers don't use it yet.

Can you either apply my patch to #if 0 it, or (if usage is planned very soon) add a function prototype to a header file?

In both cases, we get rid of a warning both by sparse and with the gcc -Wmissing-prototypes flag.

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 16 lines · Adrian Bunk
Quoted 15 lines · Vojtech Pavlik
Quoted 13 lines · Adrian Bunk
Quoted 11 lines · Vojtech Pavlik
Quoted 2 lines · Adrian Bunk

This patch contains the following possible cleanups:
- make needlessly glbal code static

Agreed.

Quoted 1 line

- gameport/gameport: #if 0 the unused global function gameport_reconnect

That one should be an EXPORT_SYMBOL() API. If the export is missing, then that's the bug that needs to be fixed.
...

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

There isn't even a header providing a function prototype which is quite strange for a part of an API.

It's a planned API (a mirror of what the serio abstraction does), the drivers don't use it yet.

Can you either apply my patch to #if 0 it, or (if usage is planned very soon) add a function prototype to a header file?

I'll add the prototype.

Quoted 17 lines

In both cases, we get rid of a warning both by sparse and with the gcc -Wmissing-prototypes flag.

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
Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR