diff options
Diffstat (limited to 'drivers/usb/atm')
-rw-r--r-- | drivers/usb/atm/usbatm.c | 10 | ||||
-rw-r--r-- | drivers/usb/atm/usbatm.h | 10 | ||||
-rw-r--r-- | drivers/usb/atm/xusbatm.c | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index 0da2c25bab3b..06dd114910d4 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c | |||
@@ -344,7 +344,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char | |||
344 | __func__, sarb->len, vcc); | 344 | __func__, sarb->len, vcc); |
345 | /* discard cells already received */ | 345 | /* discard cells already received */ |
346 | skb_trim(sarb, 0); | 346 | skb_trim(sarb, 0); |
347 | UDSL_ASSERT(sarb->tail + ATM_CELL_PAYLOAD <= sarb->end); | 347 | UDSL_ASSERT(instance, sarb->tail + ATM_CELL_PAYLOAD <= sarb->end); |
348 | } | 348 | } |
349 | 349 | ||
350 | memcpy(skb_tail_pointer(sarb), source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); | 350 | memcpy(skb_tail_pointer(sarb), source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); |
@@ -432,7 +432,7 @@ static void usbatm_extract_cells(struct usbatm_data *instance, | |||
432 | unsigned char *cell_buf = instance->cell_buf; | 432 | unsigned char *cell_buf = instance->cell_buf; |
433 | unsigned int space_left = stride - buf_usage; | 433 | unsigned int space_left = stride - buf_usage; |
434 | 434 | ||
435 | UDSL_ASSERT(buf_usage <= stride); | 435 | UDSL_ASSERT(instance, buf_usage <= stride); |
436 | 436 | ||
437 | if (avail_data >= space_left) { | 437 | if (avail_data >= space_left) { |
438 | /* add new data and process cell */ | 438 | /* add new data and process cell */ |
@@ -475,7 +475,7 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance, | |||
475 | unsigned int stride = instance->tx_channel.stride; | 475 | unsigned int stride = instance->tx_channel.stride; |
476 | 476 | ||
477 | vdbg("%s: skb->len=%d, avail_space=%u", __func__, skb->len, avail_space); | 477 | vdbg("%s: skb->len=%d, avail_space=%u", __func__, skb->len, avail_space); |
478 | UDSL_ASSERT(!(avail_space % stride)); | 478 | UDSL_ASSERT(instance, !(avail_space % stride)); |
479 | 479 | ||
480 | for (bytes_written = 0; bytes_written < avail_space && ctrl->len; | 480 | for (bytes_written = 0; bytes_written < avail_space && ctrl->len; |
481 | bytes_written += stride, target += stride) { | 481 | bytes_written += stride, target += stride) { |
@@ -547,7 +547,7 @@ static void usbatm_rx_process(unsigned long data) | |||
547 | if (!urb->iso_frame_desc[i].status) { | 547 | if (!urb->iso_frame_desc[i].status) { |
548 | unsigned int actual_length = urb->iso_frame_desc[i].actual_length; | 548 | unsigned int actual_length = urb->iso_frame_desc[i].actual_length; |
549 | 549 | ||
550 | UDSL_ASSERT(actual_length <= packet_size); | 550 | UDSL_ASSERT(instance, actual_length <= packet_size); |
551 | 551 | ||
552 | if (!merge_length) | 552 | if (!merge_length) |
553 | merge_start = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset; | 553 | merge_start = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset; |
@@ -1188,7 +1188,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, | |||
1188 | struct urb *urb; | 1188 | struct urb *urb; |
1189 | unsigned int iso_packets = usb_pipeisoc(channel->endpoint) ? channel->buf_size / channel->packet_size : 0; | 1189 | unsigned int iso_packets = usb_pipeisoc(channel->endpoint) ? channel->buf_size / channel->packet_size : 0; |
1190 | 1190 | ||
1191 | UDSL_ASSERT(!usb_pipeisoc(channel->endpoint) || usb_pipein(channel->endpoint)); | 1191 | UDSL_ASSERT(instance, !usb_pipeisoc(channel->endpoint) || usb_pipein(channel->endpoint)); |
1192 | 1192 | ||
1193 | urb = usb_alloc_urb(iso_packets, GFP_KERNEL); | 1193 | urb = usb_alloc_urb(iso_packets, GFP_KERNEL); |
1194 | if (!urb) { | 1194 | if (!urb) { |
diff --git a/drivers/usb/atm/usbatm.h b/drivers/usb/atm/usbatm.h index e6887c6cf3cf..f6f4508a9d42 100644 --- a/drivers/usb/atm/usbatm.h +++ b/drivers/usb/atm/usbatm.h | |||
@@ -40,9 +40,15 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #ifdef DEBUG | 42 | #ifdef DEBUG |
43 | #define UDSL_ASSERT(x) BUG_ON(!(x)) | 43 | #define UDSL_ASSERT(instance, x) BUG_ON(!(x)) |
44 | #else | 44 | #else |
45 | #define UDSL_ASSERT(x) do { if (!(x)) warn("failed assertion '%s' at line %d", __stringify(x), __LINE__); } while(0) | 45 | #define UDSL_ASSERT(instance, x) \ |
46 | do { \ | ||
47 | if (!(x)) \ | ||
48 | dev_warn(&(instance)->usb_intf->dev, \ | ||
49 | "failed assertion '%s' at line %d", \ | ||
50 | __stringify(x), __LINE__); \ | ||
51 | } while(0) | ||
46 | #endif | 52 | #endif |
47 | 53 | ||
48 | #define usb_err(instance, format, arg...) \ | 54 | #define usb_err(instance, format, arg...) \ |
diff --git a/drivers/usb/atm/xusbatm.c b/drivers/usb/atm/xusbatm.c index 8472543eee81..17d167bbd2dc 100644 --- a/drivers/usb/atm/xusbatm.c +++ b/drivers/usb/atm/xusbatm.c | |||
@@ -193,7 +193,7 @@ static int __init xusbatm_init(void) | |||
193 | num_vendor != num_product || | 193 | num_vendor != num_product || |
194 | num_vendor != num_rx_endpoint || | 194 | num_vendor != num_rx_endpoint || |
195 | num_vendor != num_tx_endpoint) { | 195 | num_vendor != num_tx_endpoint) { |
196 | warn("malformed module parameters"); | 196 | printk(KERN_WARNING "xusbatm: malformed module parameters\n"); |
197 | return -EINVAL; | 197 | return -EINVAL; |
198 | } | 198 | } |
199 | 199 | ||