It seems that people want BUG_ON to be like an assertion: harmless if removed.

Signed-off-by: Duncan Sands <[EMAIL PROTECTED]>

--- local-tree.orig/drivers/usb/misc/speedtch.c 2004-08-14 12:56:24.000000000 +0200
+++ local-tree/drivers/usb/misc/speedtch.c      2004-09-01 11:28:24.000000000 +0200
@@ -93,7 +93,7 @@
 #ifdef DEBUG
 #define DEBUG_ON(x)    BUG_ON(x)
 #else
-#define DEBUG_ON(x)    do { if (x); } while (0)
+#define DEBUG_ON(x)
 #endif
 
 #ifdef VERBOSE_DEBUG
@@ -518,7 +518,8 @@
                memset (target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER);
                target += ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER;
 
-               DEBUG_ON (--ctrl->num_cells);
+               --ctrl->num_cells;
+               DEBUG_ON (ctrl->num_cells);
        }
 
        memcpy (target, ctrl->aal5_trailer, ATM_AAL5_TRAILER);
@@ -1243,8 +1244,10 @@
        do {
                count = 0;
                spin_lock_irq (&instance->receive_lock);
-               list_for_each (pos, &instance->spare_receivers)
-                       DEBUG_ON (++count > num_rcv_urbs);
+               list_for_each (pos, &instance->spare_receivers) {
+                       ++count;
+                       DEBUG_ON (count > num_rcv_urbs);
+               }
                spin_unlock_irq (&instance->receive_lock);
 
                dbg ("udsl_usb_disconnect: found %u spare receivers", count);
@@ -1279,8 +1282,10 @@
        do {
                count = 0;
                spin_lock_irq (&instance->send_lock);
-               list_for_each (pos, &instance->spare_senders)
-                       DEBUG_ON (++count > num_snd_urbs);
+               list_for_each (pos, &instance->spare_senders) {
+                       ++count;
+                       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: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to