]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: serial: iuu_phoenix: drop excessive sanity checks
authorJohan Hovold <johan@kernel.org>
Mon, 3 Apr 2017 09:57:14 +0000 (11:57 +0200)
committerJohan Hovold <johan@kernel.org>
Mon, 10 Apr 2017 07:42:00 +0000 (09:42 +0200)
The transfer buffers and URBs are allocated and initialised by USB
serial core during probe, and there's no need to check for NULL transfer
buffers in the bulk-in completion handlers.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/iuu_phoenix.c

index 7dd1601e4a02d1598a15c5d07dbeeaa5b3268898..18fc992a245fcd8c700aea392ed2a1fcf9d584ea 100644 (file)
@@ -588,9 +588,8 @@ static void read_buf_callback(struct urb *urb)
        }
 
        dev_dbg(&port->dev, "%s - %i chars to write\n", __func__, urb->actual_length);
-       if (data == NULL)
-               dev_dbg(&port->dev, "%s - data is NULL !!!\n", __func__);
-       if (urb->actual_length && data) {
+
+       if (urb->actual_length) {
                tty_insert_flip_string(&port->port, data, urb->actual_length);
                tty_flip_buffer_push(&port->port);
        }
@@ -655,10 +654,8 @@ static void iuu_uart_read_callback(struct urb *urb)
                /* error stop all */
                return;
        }
-       if (data == NULL)
-               dev_dbg(&port->dev, "%s - data is NULL !!!\n", __func__);
 
-       if (urb->actual_length == 1  && data != NULL)
+       if (urb->actual_length == 1)
                len = (int) data[0];
 
        if (urb->actual_length > 1) {