ChangeSet 1.1743.3.6, 2004/05/24 17:04:38-07:00, lcapitulino@prefeitura.sp.gov.br

[PATCH] USB: /usb/gadget/serial.c warning fix.

 that code is generating the fallowing warning:

drivers/usb/gadget/serial.c:162: warning: `debug' defined but not used

 When G_SERIAL_DEBUG is not defined, `debug' is not used, because
the gs_debug() function is compiled only when G_SERIAL_DEBUG is
defined.

 Thus, a solution is to define `debug' only when G_SERIAL_DEBUG
is defined. That includes the use of `debug' as a module parameter
(this last part I'm not sure).

 The patch bellow does that (compiles ok, not tested because I don't
have that hardware):


 drivers/usb/gadget/serial.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)


diff -Nru a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
--- a/drivers/usb/gadget/serial.c	Fri May 28 14:41:26 2004
+++ b/drivers/usb/gadget/serial.c	Fri May 28 14:41:26 2004
@@ -154,14 +154,9 @@
 
 #define GS_CLOSE_TIMEOUT		15
 
-/* debug macro */
+/* debug settings */
 #if G_SERIAL_DEBUG
 static int debug = G_SERIAL_DEBUG;
-#else
-static int debug = 0;
-#endif
-
-#if G_SERIAL_DEBUG
 
 #define gs_debug(format, arg...) \
 	do { if (debug) printk(KERN_DEBUG format, ## arg); } while(0)
@@ -598,8 +593,10 @@
 MODULE_AUTHOR("Al Borchers");
 MODULE_LICENSE("GPL");
 
+#if G_SERIAL_DEBUG
 MODULE_PARM(debug, "i");
 MODULE_PARM_DESC(debug, "Enable debugging, 0=off, 1=on");
+#endif
 
 MODULE_PARM(read_q_size, "i");
 MODULE_PARM_DESC(read_q_size, "Read request queue size, default=32");
