Commit 608b973b authored by Niklas Neronin's avatar Niklas Neronin Committed by Greg Kroah-Hartman

usb: xhci: remove goto 'cleanup' in handle_tx_event()

By removing the goto 'cleanup' statement, and replacing it with 'continue',
'break' and 'return', helps simplify the code and further showcase in which
case the while loop iterates.

This change prepares for the comprehensive handle_tx_event() rework.
Signed-off-by: default avatarNiklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240429140245.3955523-14-mathias.nyman@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 26dffa42
...@@ -2727,7 +2727,9 @@ static int handle_tx_event(struct xhci_hcd *xhci, ...@@ -2727,7 +2727,9 @@ static int handle_tx_event(struct xhci_hcd *xhci,
"still with TDs queued?\n", "still with TDs queued?\n",
TRB_TO_SLOT_ID(le32_to_cpu(event->flags)), TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
ep_index); ep_index);
goto cleanup; if (ep->skip)
break;
return 0;
case COMP_RING_OVERRUN: case COMP_RING_OVERRUN:
xhci_dbg(xhci, "overrun event on endpoint\n"); xhci_dbg(xhci, "overrun event on endpoint\n");
if (!list_empty(&ep_ring->td_list)) if (!list_empty(&ep_ring->td_list))
...@@ -2735,7 +2737,9 @@ static int handle_tx_event(struct xhci_hcd *xhci, ...@@ -2735,7 +2737,9 @@ static int handle_tx_event(struct xhci_hcd *xhci,
"still with TDs queued?\n", "still with TDs queued?\n",
TRB_TO_SLOT_ID(le32_to_cpu(event->flags)), TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
ep_index); ep_index);
goto cleanup; if (ep->skip)
break;
return 0;
case COMP_MISSED_SERVICE_ERROR: case COMP_MISSED_SERVICE_ERROR:
/* /*
* When encounter missed service error, one or more isoc tds * When encounter missed service error, one or more isoc tds
...@@ -2770,7 +2774,9 @@ static int handle_tx_event(struct xhci_hcd *xhci, ...@@ -2770,7 +2774,9 @@ static int handle_tx_event(struct xhci_hcd *xhci,
xhci_warn(xhci, xhci_warn(xhci,
"ERROR Unknown event condition %u for slot %u ep %u , HC probably busted\n", "ERROR Unknown event condition %u for slot %u ep %u , HC probably busted\n",
trb_comp_code, slot_id, ep_index); trb_comp_code, slot_id, ep_index);
goto cleanup; if (ep->skip)
break;
return 0;
} }
do { do {
...@@ -2834,14 +2840,14 @@ static int handle_tx_event(struct xhci_hcd *xhci, ...@@ -2834,14 +2840,14 @@ static int handle_tx_event(struct xhci_hcd *xhci,
*/ */
if (!ep_seg && (trb_comp_code == COMP_STOPPED || if (!ep_seg && (trb_comp_code == COMP_STOPPED ||
trb_comp_code == COMP_STOPPED_LENGTH_INVALID)) { trb_comp_code == COMP_STOPPED_LENGTH_INVALID)) {
goto cleanup; continue;
} }
if (!ep_seg) { if (!ep_seg) {
if (ep->skip && usb_endpoint_xfer_isoc(&td->urb->ep->desc)) { if (ep->skip && usb_endpoint_xfer_isoc(&td->urb->ep->desc)) {
skip_isoc_td(xhci, td, ep, status); skip_isoc_td(xhci, td, ep, status);
goto cleanup; continue;
} }
/* /*
...@@ -2926,19 +2932,17 @@ static int handle_tx_event(struct xhci_hcd *xhci, ...@@ -2926,19 +2932,17 @@ static int handle_tx_event(struct xhci_hcd *xhci,
trb_comp_code)) trb_comp_code))
xhci_handle_halted_endpoint(xhci, ep, td, xhci_handle_halted_endpoint(xhci, ep, td,
EP_HARD_RESET); EP_HARD_RESET);
goto cleanup; } else {
} td->status = status;
td->status = status;
/* update the urb's actual_length and give back to the core */ /* update the urb's actual_length and give back to the core */
if (usb_endpoint_xfer_control(&td->urb->ep->desc)) if (usb_endpoint_xfer_control(&td->urb->ep->desc))
process_ctrl_td(xhci, ep, ep_ring, td, ep_trb, event); process_ctrl_td(xhci, ep, ep_ring, td, ep_trb, event);
else if (usb_endpoint_xfer_isoc(&td->urb->ep->desc)) else if (usb_endpoint_xfer_isoc(&td->urb->ep->desc))
process_isoc_td(xhci, ep, ep_ring, td, ep_trb, event); process_isoc_td(xhci, ep, ep_ring, td, ep_trb, event);
else else
process_bulk_intr_td(xhci, ep, ep_ring, td, ep_trb, event); process_bulk_intr_td(xhci, ep, ep_ring, td, ep_trb, event);
cleanup:; }
/* /*
* If ep->skip is set, it means there are missed tds on the * If ep->skip is set, it means there are missed tds on the
* endpoint ring need to take care of. * endpoint ring need to take care of.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment