aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/digi_acceleport.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-02-18 16:44:01 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 14:55:12 -0800
commita108bfcb372d8c4452701039308fb95747911c59 (patch)
tree3528621937692e28081f71131cddc3130e2641ad /drivers/usb/serial/digi_acceleport.c
parent2832fc11f1360668482beec06dbcd631ae5f0cf1 (diff)
downloadkernel_samsung_smdk4412-a108bfcb372d8c4452701039308fb95747911c59.zip
kernel_samsung_smdk4412-a108bfcb372d8c4452701039308fb95747911c59.tar.gz
kernel_samsung_smdk4412-a108bfcb372d8c4452701039308fb95747911c59.tar.bz2
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 3b63484..3817228 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)
int port_status = ((unsigned char *)urb->transfer_buffer)[2];
unsigned char *data = ((unsigned char *)urb->transfer_buffer) + 3;
int flag, throttled;
- int i;
int status = urb->status;
/* do not process callbacks on closed ports */
@@ -1705,17 +1704,9 @@ static int digi_read_inb_callback(struct urb *urb)
/* data length is len-1 (one byte of len is port_status) */
--len;
-
- len = tty_buffer_request_room(tty, len);
if (len > 0) {
- /* Hot path */
- if (flag == TTY_NORMAL)
- tty_insert_flip_string(tty, data, len);
- else {
- for (i = 0; i < len; i++)
- tty_insert_flip_char(tty,
- data[i], flag);
- }
+ tty_insert_flip_string_fixed_flag(tty, data, len,
+ flag);
tty_flip_buffer_push(tty);
}
}