Skip to content

Commit 4ccd0bb

Browse files
Dan Carpenterdavem330
authored andcommitted
hso: remove some dead code
It seems like this function was intended to have special handling for urb statuses of -ENOENT and -ECONNRESET. But now it just prints some debugging and returns at the start of the function. I have removed the dead code, it's still in the git history if anyone wants to revive it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ee262ad commit 4ccd0bb

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

drivers/net/usb/hso.c

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,42 +1201,32 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
12011201
struct hso_serial *serial = urb->context;
12021202
int status = urb->status;
12031203

1204+
D4("\n--- Got serial_read_bulk callback %02x ---", status);
1205+
12041206
/* sanity check */
12051207
if (!serial) {
12061208
D1("serial == NULL");
12071209
return;
1208-
} else if (status) {
1210+
}
1211+
if (status) {
12091212
handle_usb_error(status, __func__, serial->parent);
12101213
return;
12111214
}
12121215

1213-
D4("\n--- Got serial_read_bulk callback %02x ---", status);
12141216
D1("Actual length = %d\n", urb->actual_length);
12151217
DUMP1(urb->transfer_buffer, urb->actual_length);
12161218

12171219
/* Anyone listening? */
12181220
if (serial->port.count == 0)
12191221
return;
12201222

1221-
if (status == 0) {
1222-
if (serial->parent->port_spec & HSO_INFO_CRC_BUG)
1223-
fix_crc_bug(urb, serial->in_endp->wMaxPacketSize);
1224-
/* Valid data, handle RX data */
1225-
spin_lock(&serial->serial_lock);
1226-
serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1;
1227-
put_rxbuf_data_and_resubmit_bulk_urb(serial);
1228-
spin_unlock(&serial->serial_lock);
1229-
} else if (status == -ENOENT || status == -ECONNRESET) {
1230-
/* Unlinked - check for throttled port. */
1231-
D2("Port %d, successfully unlinked urb", serial->minor);
1232-
spin_lock(&serial->serial_lock);
1233-
serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 0;
1234-
hso_resubmit_rx_bulk_urb(serial, urb);
1235-
spin_unlock(&serial->serial_lock);
1236-
} else {
1237-
D2("Port %d, status = %d for read urb", serial->minor, status);
1238-
return;
1239-
}
1223+
if (serial->parent->port_spec & HSO_INFO_CRC_BUG)
1224+
fix_crc_bug(urb, serial->in_endp->wMaxPacketSize);
1225+
/* Valid data, handle RX data */
1226+
spin_lock(&serial->serial_lock);
1227+
serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1;
1228+
put_rxbuf_data_and_resubmit_bulk_urb(serial);
1229+
spin_unlock(&serial->serial_lock);
12401230
}
12411231

12421232
/*

0 commit comments

Comments
 (0)