Dave --
Here is a patch for gadget serial for 2.4 that fixes
the wait_cond_interruptible_timeout macro and the
"debug defined but not used" warning.
This is against bk://kernel.bkbits.net/db/linux/gadget-2.4.
Thanks,
-- Al
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1154 -> 1.1155
# drivers/usb/gadget/gserial.c 1.1 -> 1.2
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/10/08 [EMAIL PROTECTED](none) 1.1155
# Fixed wait_cond_interruptible_timeout so it actually returns after the
# timeout expires. Fixed debug defined but not used.
# --------------------------------------------
#
diff -Nru a/drivers/usb/gadget/gserial.c b/drivers/usb/gadget/gserial.c
--- a/drivers/usb/gadget/gserial.c Wed Oct 8 23:56:47 2003
+++ b/drivers/usb/gadget/gserial.c Wed Oct 8 23:56:47 2003
@@ -98,17 +98,20 @@
#define __wait_cond_interruptible_timeout(wq, condition, lock, flags, \
timeout, ret) \
do { \
+ signed long __timeout = timeout; \
wait_queue_t __wait; \
init_waitqueue_entry(&__wait, current); \
\
add_wait_queue(&wq, &__wait); \
for (;;) { \
set_current_state(TASK_INTERRUPTIBLE); \
+ if (__timeout == 0) \
+ break; \
if (condition) \
break; \
if (!signal_pending(current)) { \
spin_unlock_irqrestore(lock, flags); \
- schedule_timeout(timeout); \
+ __timeout = schedule_timeout(__timeout); \
spin_lock_irqsave(lock, flags); \
continue; \
} \
@@ -167,22 +170,22 @@
#define GS_CLOSE_TIMEOUT 15
/* debug macro */
-#if G_SERIAL_DEBUG >= 1
+#if G_SERIAL_DEBUG
+
static int debug = G_SERIAL_DEBUG;
-#else
-static int debug = 0;
-#endif
-#ifdef G_SERIAL_DEBUG
#define gs_debug(format, arg...) \
do { if(debug) printk( KERN_DEBUG format, ## arg ); } while(0)
#define gs_debug_level(level, format, arg...) \
do { if(debug>=level) printk( KERN_DEBUG format, ## arg ); } while(0)
+
#else
+
#define gs_debug(format, arg...) \
do { } while(0)
#define gs_debug_level(level, format, arg...) \
do { } while(0)
+
#endif /* G_SERIAL_DEBUG */