diff options
Diffstat (limited to 'drivers/usb/atm/usbatm.c')
-rw-r--r-- | drivers/usb/atm/usbatm.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index 9b53e8df4648..05bf5a27b5b0 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c | |||
@@ -84,8 +84,8 @@ | |||
84 | 84 | ||
85 | #ifdef VERBOSE_DEBUG | 85 | #ifdef VERBOSE_DEBUG |
86 | static int usbatm_print_packet(const unsigned char *data, int len); | 86 | static int usbatm_print_packet(const unsigned char *data, int len); |
87 | #define PACKETDEBUG(arg...) usbatm_print_packet (arg) | 87 | #define PACKETDEBUG(arg...) usbatm_print_packet(arg) |
88 | #define vdbg(arg...) dbg (arg) | 88 | #define vdbg(arg...) dbg(arg) |
89 | #else | 89 | #else |
90 | #define PACKETDEBUG(arg...) | 90 | #define PACKETDEBUG(arg...) |
91 | #define vdbg(arg...) | 91 | #define vdbg(arg...) |
@@ -273,8 +273,7 @@ static void usbatm_complete(struct urb *urb) | |||
273 | 273 | ||
274 | if (unlikely(status) && | 274 | if (unlikely(status) && |
275 | (!(channel->usbatm->flags & UDSL_IGNORE_EILSEQ) || | 275 | (!(channel->usbatm->flags & UDSL_IGNORE_EILSEQ) || |
276 | status != -EILSEQ )) | 276 | status != -EILSEQ)) { |
277 | { | ||
278 | if (status == -ESHUTDOWN) | 277 | if (status == -ESHUTDOWN) |
279 | return; | 278 | return; |
280 | 279 | ||
@@ -494,7 +493,7 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance, | |||
494 | ptr += data_len; | 493 | ptr += data_len; |
495 | __skb_pull(skb, data_len); | 494 | __skb_pull(skb, data_len); |
496 | 495 | ||
497 | if(!left) | 496 | if (!left) |
498 | continue; | 497 | continue; |
499 | 498 | ||
500 | memset(ptr, 0, left); | 499 | memset(ptr, 0, left); |
@@ -506,7 +505,7 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance, | |||
506 | trailer[2] = ctrl->len >> 8; | 505 | trailer[2] = ctrl->len >> 8; |
507 | trailer[3] = ctrl->len; | 506 | trailer[3] = ctrl->len; |
508 | 507 | ||
509 | ctrl->crc = ~ crc32_be(ctrl->crc, ptr, left - 4); | 508 | ctrl->crc = ~crc32_be(ctrl->crc, ptr, left - 4); |
510 | 509 | ||
511 | trailer[4] = ctrl->crc >> 24; | 510 | trailer[4] = ctrl->crc >> 24; |
512 | trailer[5] = ctrl->crc >> 16; | 511 | trailer[5] = ctrl->crc >> 16; |
@@ -516,8 +515,7 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance, | |||
516 | target[3] |= 0x2; /* adjust PTI */ | 515 | target[3] |= 0x2; /* adjust PTI */ |
517 | 516 | ||
518 | ctrl->len = 0; /* tag this skb finished */ | 517 | ctrl->len = 0; /* tag this skb finished */ |
519 | } | 518 | } else |
520 | else | ||
521 | ctrl->crc = crc32_be(ctrl->crc, ptr, left); | 519 | ctrl->crc = crc32_be(ctrl->crc, ptr, left); |
522 | } | 520 | } |
523 | 521 | ||
@@ -1146,7 +1144,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, | |||
1146 | instance->tx_channel.endpoint = usb_sndbulkpipe(usb_dev, driver->bulk_out); | 1144 | instance->tx_channel.endpoint = usb_sndbulkpipe(usb_dev, driver->bulk_out); |
1147 | 1145 | ||
1148 | /* tx buffer size must be a positive multiple of the stride */ | 1146 | /* tx buffer size must be a positive multiple of the stride */ |
1149 | instance->tx_channel.buf_size = max (instance->tx_channel.stride, | 1147 | instance->tx_channel.buf_size = max(instance->tx_channel.stride, |
1150 | snd_buf_bytes - (snd_buf_bytes % instance->tx_channel.stride)); | 1148 | snd_buf_bytes - (snd_buf_bytes % instance->tx_channel.stride)); |
1151 | 1149 | ||
1152 | /* rx buffer size must be a positive multiple of the endpoint maxpacket */ | 1150 | /* rx buffer size must be a positive multiple of the endpoint maxpacket */ |
@@ -1159,7 +1157,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, | |||
1159 | goto fail_unbind; | 1157 | goto fail_unbind; |
1160 | } | 1158 | } |
1161 | 1159 | ||
1162 | num_packets = max (1U, (rcv_buf_bytes + maxpacket / 2) / maxpacket); /* round */ | 1160 | num_packets = max(1U, (rcv_buf_bytes + maxpacket / 2) / maxpacket); /* round */ |
1163 | 1161 | ||
1164 | if (num_packets * maxpacket > UDSL_MAX_BUF_SIZE) | 1162 | if (num_packets * maxpacket > UDSL_MAX_BUF_SIZE) |
1165 | num_packets--; | 1163 | num_packets--; |
@@ -1262,7 +1260,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, | |||
1262 | usb_free_urb(instance->urbs[i]); | 1260 | usb_free_urb(instance->urbs[i]); |
1263 | } | 1261 | } |
1264 | 1262 | ||
1265 | kfree (instance); | 1263 | kfree(instance); |
1266 | 1264 | ||
1267 | return error; | 1265 | return error; |
1268 | } | 1266 | } |
@@ -1390,9 +1388,8 @@ static int usbatm_print_packet(const unsigned char *data, int len) | |||
1390 | for (i = 0; i < len;) { | 1388 | for (i = 0; i < len;) { |
1391 | buffer[0] = '\0'; | 1389 | buffer[0] = '\0'; |
1392 | sprintf(buffer, "%.3d :", i); | 1390 | sprintf(buffer, "%.3d :", i); |
1393 | for (j = 0; (j < 16) && (i < len); j++, i++) { | 1391 | for (j = 0; (j < 16) && (i < len); j++, i++) |
1394 | sprintf(buffer, "%s %2.2x", buffer, data[i]); | 1392 | sprintf(buffer, "%s %2.2x", buffer, data[i]); |
1395 | } | ||
1396 | dbg("%s", buffer); | 1393 | dbg("%s", buffer); |
1397 | } | 1394 | } |
1398 | return i; | 1395 | return i; |