ChangeSet 1.2061.1.3, 2004/10/06 13:25:20+01:00, [EMAIL PROTECTED]

USB: Fix assertion logic in USB ATM core.

We assert something we believe to be _true_, not false.

Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/usb/atm/usb_atm.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


diff -Nru a/drivers/usb/atm/usb_atm.c b/drivers/usb/atm/usb_atm.c
--- a/drivers/usb/atm/usb_atm.c 2004-10-19 08:06:43 -07:00
+++ b/drivers/usb/atm/usb_atm.c 2004-10-19 08:06:43 -07:00
@@ -95,9 +95,9 @@
 #include <linux/usb.h>
 
 #ifdef DEBUG
-#define UDSL_ASSERT(x) BUG_ON(x)
+#define UDSL_ASSERT(x) BUG_ON(!(x))
 #else
-#define UDSL_ASSERT(x)
+#define UDSL_ASSERT(x) warn("failed assertion '" #x "' at line %d", __LINE__)
 #endif
 
 #ifdef VERBOSE_DEBUG
@@ -406,7 +406,7 @@
                target += ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER;
 
                --ctrl->num_cells;
-               UDSL_ASSERT(ctrl->num_cells);
+               UDSL_ASSERT(!ctrl->num_cells);
        }
 
        memcpy(target, ctrl->aal5_trailer, ATM_AAL5_TRAILER);
@@ -445,7 +445,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);
 
-       UDSL_ASSERT(buf->filled_cells > rcv_buf_size);
+       UDSL_ASSERT(buf->filled_cells <= rcv_buf_size);
 
        /* may not be in_interrupt() */
        spin_lock_irqsave(&instance->receive_lock, flags);



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to