Skip to contentSkip to conversation

USB: serial: Avoid goto in bulk callbacks

DISCUSSION Johan Hovold 1 participant 1 message Dec 11, 2017 USB

lore
Share & tools
lore
#0 lore raw
Quoted 12 lines · Ladislav Michl

Refactor bulk callback functions to make use of goto pointless.

---
 drivers/usb/serial/generic.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/usb/serial/generic.c +0 -0
index 2274d9625f63..d1a09ba10b6f 100644

drivers/usb/serial/generic.c void usb_serial_generic_read_bulk_callback(struct urb *urb) · line 395

Quoted 7 lines
drivers/usb/serial/generic.c +3 -0
@@ -389,6 +389,9 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)
 							urb->actual_length);
 	switch (status) {
 	case 0:
+		usb_serial_debug_data(&port->dev, __func__,
+					urb->actual_length, data);
+		port->serial->type->process_read_urb(urb);
 		break;

So as for the ti driver, I prefer keeping the success path out of the switch statement.

Thanks,
Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html