Skip to content

Commit b44c0ce

Browse files
Epicuriusgregkh
authored andcommitted
usb: xhci: remove duplicate TRB_TO_SLOT_ID() calls
Remove unnecessary repeated calls to TRB_TO_SLOT_ID(). The slot ID is stored in the 'slot_id' variable at the function's start. Signed-off-by: Niklas Neronin <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d6b2b69 commit b44c0ce

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,20 +2723,16 @@ static int handle_tx_event(struct xhci_hcd *xhci,
27232723
*/
27242724
xhci_dbg(xhci, "underrun event on endpoint\n");
27252725
if (!list_empty(&ep_ring->td_list))
2726-
xhci_dbg(xhci, "Underrun Event for slot %d ep %d "
2727-
"still with TDs queued?\n",
2728-
TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
2729-
ep_index);
2726+
xhci_dbg(xhci, "Underrun Event for slot %u ep %d still with TDs queued?\n",
2727+
slot_id, ep_index);
27302728
if (ep->skip)
27312729
break;
27322730
return 0;
27332731
case COMP_RING_OVERRUN:
27342732
xhci_dbg(xhci, "overrun event on endpoint\n");
27352733
if (!list_empty(&ep_ring->td_list))
2736-
xhci_dbg(xhci, "Overrun Event for slot %d ep %d "
2737-
"still with TDs queued?\n",
2738-
TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
2739-
ep_index);
2734+
xhci_dbg(xhci, "Overrun Event for slot %u ep %d still with TDs queued?\n",
2735+
slot_id, ep_index);
27402736
if (ep->skip)
27412737
break;
27422738
return 0;
@@ -2795,9 +2791,8 @@ static int handle_tx_event(struct xhci_hcd *xhci,
27952791
if (!(trb_comp_code == COMP_STOPPED ||
27962792
trb_comp_code == COMP_STOPPED_LENGTH_INVALID ||
27972793
ep_ring->last_td_was_short)) {
2798-
xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n",
2799-
TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
2800-
ep_index);
2794+
xhci_warn(xhci, "WARN Event TRB for slot %u ep %d with no TDs queued?\n",
2795+
slot_id, ep_index);
28012796
}
28022797
if (ep->skip) {
28032798
ep->skip = false;

0 commit comments

Comments
 (0)