Commit 7234f3cb authored by Luiz Capitulino's avatar Luiz Capitulino Committed by Greg Kroah-Hartman

[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):
parent 461b6851
......@@ -154,14 +154,9 @@ do { \
#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_DESCRIPTION(GS_LONG_NAME);
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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment