Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
David S. Miller
4ccd0bb9 ee262ad8

+11 -21
+11 -21
drivers/net/usb/hso.c
··· 1201 1201 struct hso_serial *serial = urb->context; 1202 1202 int status = urb->status; 1203 1203 1204 + D4("\n--- Got serial_read_bulk callback %02x ---", status); 1205 + 1204 1206 /* sanity check */ 1205 1207 if (!serial) { 1206 1208 D1("serial == NULL"); 1207 1209 return; 1208 - } else if (status) { 1210 + } 1211 + if (status) { 1209 1212 handle_usb_error(status, __func__, serial->parent); 1210 1213 return; 1211 1214 } 1212 1215 1213 - D4("\n--- Got serial_read_bulk callback %02x ---", status); 1214 1216 D1("Actual length = %d\n", urb->actual_length); 1215 1217 DUMP1(urb->transfer_buffer, urb->actual_length); 1216 1218 ··· 1220 1218 if (serial->port.count == 0) 1221 1219 return; 1222 1220 1223 - if (status == 0) { 1224 - if (serial->parent->port_spec & HSO_INFO_CRC_BUG) 1225 - fix_crc_bug(urb, serial->in_endp->wMaxPacketSize); 1226 - /* Valid data, handle RX data */ 1227 - spin_lock(&serial->serial_lock); 1228 - serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1; 1229 - put_rxbuf_data_and_resubmit_bulk_urb(serial); 1230 - spin_unlock(&serial->serial_lock); 1231 - } else if (status == -ENOENT || status == -ECONNRESET) { 1232 - /* Unlinked - check for throttled port. */ 1233 - D2("Port %d, successfully unlinked urb", serial->minor); 1234 - spin_lock(&serial->serial_lock); 1235 - serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 0; 1236 - hso_resubmit_rx_bulk_urb(serial, urb); 1237 - spin_unlock(&serial->serial_lock); 1238 - } else { 1239 - D2("Port %d, status = %d for read urb", serial->minor, status); 1240 - return; 1241 - } 1221 + if (serial->parent->port_spec & HSO_INFO_CRC_BUG) 1222 + fix_crc_bug(urb, serial->in_endp->wMaxPacketSize); 1223 + /* Valid data, handle RX data */ 1224 + spin_lock(&serial->serial_lock); 1225 + serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1; 1226 + put_rxbuf_data_and_resubmit_bulk_urb(serial); 1227 + spin_unlock(&serial->serial_lock); 1242 1228 } 1243 1229 1244 1230 /*