提交 69defe04 编写于 作者: M Mathias Nyman 提交者: Greg Kroah-Hartman

xhci: cleanup finish_td function

Remove unnecessary else after return, dropping extra indentation depth.
No functional changes.
Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c00552eb
...@@ -1813,72 +1813,65 @@ static int finish_td(struct xhci_hcd *xhci, struct xhci_td *td, ...@@ -1813,72 +1813,65 @@ static int finish_td(struct xhci_hcd *xhci, struct xhci_td *td,
if (skip) if (skip)
goto td_cleanup; goto td_cleanup;
if (trb_comp_code == COMP_STOP_INVAL || if (trb_comp_code == COMP_STOP_INVAL || trb_comp_code == COMP_STOP) {
trb_comp_code == COMP_STOP) {
/* The Endpoint Stop Command completion will take care of any /* The Endpoint Stop Command completion will take care of any
* stopped TDs. A stopped TD may be restarted, so don't update * stopped TDs. A stopped TD may be restarted, so don't update
* the ring dequeue pointer or take this TD off any lists yet. * the ring dequeue pointer or take this TD off any lists yet.
*/ */
ep->stopped_td = td; ep->stopped_td = td;
return 0; return 0;
}
if (trb_comp_code == COMP_STALL ||
xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
trb_comp_code)) {
/* Issue a reset endpoint command to clear the host side
* halt, followed by a set dequeue command to move the
* dequeue pointer past the TD.
* The class driver clears the device side halt later.
*/
xhci_cleanup_halted_endpoint(xhci, slot_id, ep_index,
ep_ring->stream_id, td, event_trb);
} else { } else {
if (trb_comp_code == COMP_STALL || /* Update ring dequeue pointer */
xhci_requires_manual_halt_cleanup(xhci, ep_ctx, while (ep_ring->dequeue != td->last_trb)
trb_comp_code)) {
/* Issue a reset endpoint command to clear the host side
* halt, followed by a set dequeue command to move the
* dequeue pointer past the TD.
* The class driver clears the device side halt later.
*/
xhci_cleanup_halted_endpoint(xhci,
slot_id, ep_index, ep_ring->stream_id,
td, event_trb);
} else {
/* Update ring dequeue pointer */
while (ep_ring->dequeue != td->last_trb)
inc_deq(xhci, ep_ring);
inc_deq(xhci, ep_ring); inc_deq(xhci, ep_ring);
} inc_deq(xhci, ep_ring);
}
td_cleanup: td_cleanup:
/* Clean up the endpoint's TD list */ /* Clean up the endpoint's TD list */
urb = td->urb; urb = td->urb;
urb_priv = urb->hcpriv; urb_priv = urb->hcpriv;
/* Do one last check of the actual transfer length. /* Do one last check of the actual transfer length.
* If the host controller said we transferred more data than * If the host controller said we transferred more data than the buffer
* the buffer length, urb->actual_length will be a very big * length, urb->actual_length will be a very big number (since it's
* number (since it's unsigned). Play it safe and say we didn't * unsigned). Play it safe and say we didn't transfer anything.
* transfer anything. */
*/ if (urb->actual_length > urb->transfer_buffer_length) {
if (urb->actual_length > urb->transfer_buffer_length) { xhci_warn(xhci, "URB transfer length is wrong, xHC issue? req. len = %u, act. len = %u\n",
xhci_warn(xhci, "URB transfer length is wrong, " urb->transfer_buffer_length,
"xHC issue? req. len = %u, " urb->actual_length);
"act. len = %u\n", urb->actual_length = 0;
urb->transfer_buffer_length, if (td->urb->transfer_flags & URB_SHORT_NOT_OK)
urb->actual_length); *status = -EREMOTEIO;
urb->actual_length = 0; else
if (td->urb->transfer_flags & URB_SHORT_NOT_OK) *status = 0;
*status = -EREMOTEIO; }
else list_del_init(&td->td_list);
*status = 0; /* Was this TD slated to be cancelled but completed anyway? */
} if (!list_empty(&td->cancelled_td_list))
list_del_init(&td->td_list); list_del_init(&td->cancelled_td_list);
/* Was this TD slated to be cancelled but completed anyway? */
if (!list_empty(&td->cancelled_td_list)) urb_priv->td_cnt++;
list_del_init(&td->cancelled_td_list); /* Giveback the urb when all the tds are completed */
if (urb_priv->td_cnt == urb_priv->length) {
urb_priv->td_cnt++; ret = 1;
/* Giveback the urb when all the tds are completed */ if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) {
if (urb_priv->td_cnt == urb_priv->length) { xhci_to_hcd(xhci)->self.bandwidth_isoc_reqs--;
ret = 1; if (xhci_to_hcd(xhci)->self.bandwidth_isoc_reqs == 0) {
if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) { if (xhci->quirks & XHCI_AMD_PLL_FIX)
xhci_to_hcd(xhci)->self.bandwidth_isoc_reqs--; usb_amd_quirk_pll_enable();
if (xhci_to_hcd(xhci)->self.bandwidth_isoc_reqs
== 0) {
if (xhci->quirks & XHCI_AMD_PLL_FIX)
usb_amd_quirk_pll_enable();
}
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册