diff options
-rw-r--r-- | drivers/usb/host/r8a66597-hcd.c | 6 | ||||
-rw-r--r-- | drivers/usb/misc/usbtest.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 4 | ||||
-rw-r--r-- | drivers/usb/serial/io_ti.c | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 9f80e5285575..afd4fbe7713c 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
@@ -960,9 +960,9 @@ static void prepare_packet_read(struct r8a66597 *r8a66597, | |||
960 | r8a66597_write(r8a66597, TRCLR, | 960 | r8a66597_write(r8a66597, TRCLR, |
961 | td->pipe->pipetre); | 961 | td->pipe->pipetre); |
962 | r8a66597_write(r8a66597, | 962 | r8a66597_write(r8a66597, |
963 | (urb->transfer_buffer_length | 963 | DIV_ROUND_UP |
964 | + td->maxpacket - 1) | 964 | (urb->transfer_buffer_length, |
965 | / td->maxpacket, | 965 | td->maxpacket), |
966 | td->pipe->pipetrn); | 966 | td->pipe->pipetrn); |
967 | r8a66597_bset(r8a66597, TRENB, | 967 | r8a66597_bset(r8a66597, TRENB, |
968 | td->pipe->pipetre); | 968 | td->pipe->pipetre); |
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index b6b5b2affad1..17100471e461 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c | |||
@@ -1404,7 +1404,7 @@ static struct urb *iso_alloc_urb ( | |||
1404 | return NULL; | 1404 | return NULL; |
1405 | maxp = 0x7ff & le16_to_cpu(desc->wMaxPacketSize); | 1405 | maxp = 0x7ff & le16_to_cpu(desc->wMaxPacketSize); |
1406 | maxp *= 1 + (0x3 & (le16_to_cpu(desc->wMaxPacketSize) >> 11)); | 1406 | maxp *= 1 + (0x3 & (le16_to_cpu(desc->wMaxPacketSize) >> 11)); |
1407 | packets = (bytes + maxp - 1) / maxp; | 1407 | packets = DIV_ROUND_UP(bytes, maxp); |
1408 | 1408 | ||
1409 | urb = usb_alloc_urb (packets, GFP_KERNEL); | 1409 | urb = usb_alloc_urb (packets, GFP_KERNEL); |
1410 | if (!urb) | 1410 | if (!urb) |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 4643212eb959..496c0c93ad81 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -1406,7 +1406,7 @@ static void ftdi_write_bulk_callback (struct urb *urb) | |||
1406 | data_offset = priv->write_offset; | 1406 | data_offset = priv->write_offset; |
1407 | if (data_offset > 0) { | 1407 | if (data_offset > 0) { |
1408 | /* Subtract the control bytes */ | 1408 | /* Subtract the control bytes */ |
1409 | countback -= (data_offset * ((countback + (PKTSZ - 1)) / PKTSZ)); | 1409 | countback -= (data_offset * DIV_ROUND_UP(countback, PKTSZ)); |
1410 | } | 1410 | } |
1411 | spin_lock_irqsave(&priv->tx_lock, flags); | 1411 | spin_lock_irqsave(&priv->tx_lock, flags); |
1412 | --priv->tx_outstanding_urbs; | 1412 | --priv->tx_outstanding_urbs; |
@@ -1506,7 +1506,7 @@ static void ftdi_read_bulk_callback (struct urb *urb) | |||
1506 | 1506 | ||
1507 | /* count data bytes, but not status bytes */ | 1507 | /* count data bytes, but not status bytes */ |
1508 | countread = urb->actual_length; | 1508 | countread = urb->actual_length; |
1509 | countread -= 2 * ((countread + (PKTSZ - 1)) / PKTSZ); | 1509 | countread -= 2 * DIV_ROUND_UP(countread, PKTSZ); |
1510 | spin_lock_irqsave(&priv->rx_lock, flags); | 1510 | spin_lock_irqsave(&priv->rx_lock, flags); |
1511 | priv->rx_bytes += countread; | 1511 | priv->rx_bytes += countread; |
1512 | spin_unlock_irqrestore(&priv->rx_lock, flags); | 1512 | spin_unlock_irqrestore(&priv->rx_lock, flags); |
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 39d71fdb5071..6afee30a6a5c 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -654,7 +654,7 @@ static void TIChasePort(struct edgeport_port *port, unsigned long timeout, int f | |||
654 | /* (TIIsTxActive doesn't seem to wait for the last byte) */ | 654 | /* (TIIsTxActive doesn't seem to wait for the last byte) */ |
655 | if ((baud_rate=port->baud_rate) == 0) | 655 | if ((baud_rate=port->baud_rate) == 0) |
656 | baud_rate = 50; | 656 | baud_rate = 50; |
657 | msleep(max(1,(10000+baud_rate-1)/baud_rate)); | 657 | msleep(max(1, DIV_ROUND_UP(10000, baud_rate))); |
658 | } | 658 | } |
659 | 659 | ||
660 | static int TIChooseConfiguration (struct usb_device *dev) | 660 | static int TIChooseConfiguration (struct usb_device *dev) |