aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/digi_acceleport.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-02-18 11:44:01 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:55:12 -0500
commita108bfcb372d8c4452701039308fb95747911c59 (patch)
tree3528621937692e28081f71131cddc3130e2641ad /drivers/usb/serial/digi_acceleport.c
parent2832fc11f1360668482beec06dbcd631ae5f0cf1 (diff)
USB: tty: Prune uses of tty_request_room in the USB layer
We have lots of callers that do not need to do this in the first place. Remove the calls as they both cost CPU and for big buffers can mess up the multi-page allocation avoidance. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/digi_acceleport.c')
-rw-r--r--drivers/usb/serial/digi_acceleport.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 3b6348414c47..381722858424 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -1658,7 +1658,6 @@ static int digi_read_inb_callback(struct urb *urb)
1658 int port_status = ((unsigned char *)urb->transfer_buffer)[2]; 1658 int port_status = ((unsigned char *)urb->transfer_buffer)[2];
1659 unsigned char *data = ((unsigned char *)urb->transfer_buffer) + 3; 1659 unsigned char *data = ((unsigned char *)urb->transfer_buffer) + 3;
1660 int flag, throttled; 1660 int flag, throttled;
1661 int i;
1662 int status = urb->status; 1661 int status = urb->status;
1663 1662
1664 /* do not process callbacks on closed ports */ 1663 /* do not process callbacks on closed ports */
@@ -1705,17 +1704,9 @@ static int digi_read_inb_callback(struct urb *urb)
1705 1704
1706 /* data length is len-1 (one byte of len is port_status) */ 1705 /* data length is len-1 (one byte of len is port_status) */
1707 --len; 1706 --len;
1708
1709 len = tty_buffer_request_room(tty, len);
1710 if (len > 0) { 1707 if (len > 0) {
1711 /* Hot path */ 1708 tty_insert_flip_string_fixed_flag(tty, data, len,
1712 if (flag == TTY_NORMAL) 1709 flag);
1713 tty_insert_flip_string(tty, data, len);
1714 else {
1715 for (i = 0; i < len; i++)
1716 tty_insert_flip_char(tty,
1717 data[i], flag);
1718 }
1719 tty_flip_buffer_push(tty); 1710 tty_flip_buffer_push(tty);
1720 } 1711 }
1721 } 1712 }