diff options
author | Johan Hovold <johan@kernel.org> | 2017-04-03 11:57:14 +0200 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2017-04-10 09:42:00 +0200 |
commit | 7aac5e7d204f344f5f273deeeb8fd237e4f5b87c (patch) | |
tree | 8e6db5909972d2525cbc8fcd33151123e38b4f25 /drivers/usb | |
parent | e1fdd5b2620198979b23abb679848a78461481e6 (diff) |
USB: serial: iuu_phoenix: drop excessive sanity checks
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/iuu_phoenix.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 7dd1601e4a02..18fc992a245f 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c @@ -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) { |