2.4 version.
speedtch.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff -Nru a/drivers/usb/speedtch.c b/drivers/usb/speedtch.c
--- a/drivers/usb/speedtch.c Mon Sep 29 14:53:34 2003
+++ b/drivers/usb/speedtch.c Mon Sep 29 14:53:34 2003
@@ -85,6 +85,11 @@
#include <linux/usb.h>
+#ifdef DEBUG
+#define DEBUG_ON(x) BUG_ON(x)
+#else
+#define DEBUG_ON(x) do { if (x); } while (0)
+#endif
#ifdef VERBOSE_DEBUG
static int udsl_print_packet (const unsigned char *data, int len);
@@ -352,7 +357,7 @@
dbg ("udsl_extract_cells: buffer overrun (max_pdu: %u,
skb->len %u, vcc: 0x%p)", vcc_data->max_pdu, skb->len, vcc);
/* discard cells already received */
skb_trim (skb, 0);
- BUG_ON (vcc_data->max_pdu < ATM_CELL_PAYLOAD);
+ DEBUG_ON (vcc_data->max_pdu < ATM_CELL_PAYLOAD);
}
memcpy (skb->tail, source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD);
@@ -499,7 +504,7 @@
memset (target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER);
target += ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER;
- BUG_ON (--ctrl->num_cells);
+ DEBUG_ON (--ctrl->num_cells);
}
memcpy (target, ctrl->aal5_trailer, ATM_AAL5_TRAILER);
@@ -536,7 +541,7 @@
vdbg ("udsl_complete_receive: urb 0x%p, status %d, actual_length %d,
filled_cells %u, rcv 0x%p, buf 0x%p", urb, urb->status, urb->actual_length,
buf->filled_cells, rcv, buf);
- BUG_ON (buf->filled_cells > rcv_buf_size);
+ DEBUG_ON (buf->filled_cells > rcv_buf_size);
/* may not be in_interrupt() */
spin_lock_irqsave (&instance->receive_lock, flags);
@@ -1214,8 +1219,7 @@
count = 0;
spin_lock_irq (&instance->receive_lock);
list_for_each (pos, &instance->spare_receivers)
- if (++count > num_rcv_urbs)
- panic (__FILE__ ": memory corruption detected at line
%d!\n", __LINE__);
+ DEBUG_ON (++count > num_rcv_urbs);
spin_unlock_irq (&instance->receive_lock);
dbg ("udsl_usb_disconnect: found %u spare receivers", count);
@@ -1251,8 +1255,7 @@
count = 0;
spin_lock_irq (&instance->send_lock);
list_for_each (pos, &instance->spare_senders)
- if (++count > num_snd_urbs)
- panic (__FILE__ ": memory corruption detected at line
%d!\n", __LINE__);
+ DEBUG_ON (++count > num_snd_urbs);
spin_unlock_irq (&instance->send_lock);
dbg ("udsl_usb_disconnect: found %u spare senders", count);
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel