Commit a0e64cc0 authored by Duncan Sands's avatar Duncan Sands Committed by Greg Kroah-Hartman

[PATCH] usb speedtch: no side-effects in BUG_ON

It seems that people want BUG_ON to be like an assertion: harmless if removed.
Signed-off-by: default avatarDuncan Sands <baldrick@free.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 90578145
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
#ifdef DEBUG #ifdef DEBUG
#define DEBUG_ON(x) BUG_ON(x) #define DEBUG_ON(x) BUG_ON(x)
#else #else
#define DEBUG_ON(x) do { if (x); } while (0) #define DEBUG_ON(x)
#endif #endif
#ifdef VERBOSE_DEBUG #ifdef VERBOSE_DEBUG
...@@ -518,7 +518,8 @@ static unsigned int udsl_write_cells (unsigned int howmany, struct sk_buff *skb, ...@@ -518,7 +518,8 @@ static unsigned int udsl_write_cells (unsigned int howmany, struct sk_buff *skb,
memset (target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER); memset (target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER);
target += 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); memcpy (target, ctrl->aal5_trailer, ATM_AAL5_TRAILER);
...@@ -1243,8 +1244,10 @@ static void udsl_usb_disconnect (struct usb_interface *intf) ...@@ -1243,8 +1244,10 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
do { do {
count = 0; count = 0;
spin_lock_irq (&instance->receive_lock); spin_lock_irq (&instance->receive_lock);
list_for_each (pos, &instance->spare_receivers) list_for_each (pos, &instance->spare_receivers) {
DEBUG_ON (++count > num_rcv_urbs); ++count;
DEBUG_ON (count > num_rcv_urbs);
}
spin_unlock_irq (&instance->receive_lock); spin_unlock_irq (&instance->receive_lock);
dbg ("udsl_usb_disconnect: found %u spare receivers", count); dbg ("udsl_usb_disconnect: found %u spare receivers", count);
...@@ -1279,8 +1282,10 @@ static void udsl_usb_disconnect (struct usb_interface *intf) ...@@ -1279,8 +1282,10 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
do { do {
count = 0; count = 0;
spin_lock_irq (&instance->send_lock); spin_lock_irq (&instance->send_lock);
list_for_each (pos, &instance->spare_senders) list_for_each (pos, &instance->spare_senders) {
DEBUG_ON (++count > num_snd_urbs); ++count;
DEBUG_ON (count > num_snd_urbs);
}
spin_unlock_irq (&instance->send_lock); spin_unlock_irq (&instance->send_lock);
dbg ("udsl_usb_disconnect: found %u spare senders", count); dbg ("udsl_usb_disconnect: found %u spare senders", count);
......
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