omninet: Use string flip functions
authorAlan Cox <alan@redhat.com>
Tue, 22 Jul 2008 10:16:03 +0000 (11:16 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Jul 2008 20:03:26 +0000 (13:03 -0700)
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/usb/serial/omninet.c

index 5a76f327ef52b7efbee6879fd870e73af06406ad..ae8e227f3db2c940a9cd0fb65b1be4641162ac95 100644 (file)
@@ -206,8 +206,8 @@ static void omninet_read_bulk_callback(struct urb *urb)
        unsigned char           *data   = urb->transfer_buffer;
        struct omninet_header   *header = (struct omninet_header *) &data[0];
        int status = urb->status;
-       int i;
        int result;
+       int i;
 
        dbg("%s - port %d", __func__, port->number);
 
@@ -229,9 +229,8 @@ static void omninet_read_bulk_callback(struct urb *urb)
        }
 
        if (urb->actual_length && header->oh_len) {
-               for (i = 0; i < header->oh_len; i++)
-                        tty_insert_flip_char(port->port.tty,
-                                       data[OMNINET_DATAOFFSET + i], 0);
+               tty_insert_flip_string(port->port.tty,
+                       data + OMNINET_DATAOFFSET, header->oh_len);
                tty_flip_buffer_push(port->port.tty);
        }