Skip to content

Commit

Permalink
USB: serial: iuu_phoenix: drop excessive sanity checks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold committed Apr 10, 2017
1 parent e1fdd5b commit 7aac5e7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/usb/serial/iuu_phoenix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7aac5e7

Please sign in to comment.