diff options
author | Andy Shevchenko <[email protected]> | 2022-11-23 16:49:01 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2022-11-29 08:56:09 +0100 |
commit | b47ec9727f47d1dce4e8cbc9aef01c80b2332535 (patch) | |
tree | b761c77c3f6ab8d50ead7bc0a865c439b9a93640 | |
parent | c2d9d02f7bf3c641f9b8e6c9f5de1e564cdeca69 (diff) |
xhci: Convert to use list_count()
The list API now provides the list_count() to help with counting
existing nodes in the list. Utilise it.
Acked-by: Mathias Nyman <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index ad81e9a508b1..817c31e3b0c8 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2532,7 +2532,6 @@ static int handle_tx_event(struct xhci_hcd *xhci, union xhci_trb *ep_trb; int status = -EINPROGRESS; struct xhci_ep_ctx *ep_ctx; - struct list_head *tmp; u32 trb_comp_code; int td_num = 0; bool handling_skipped_tds = false; @@ -2580,10 +2579,8 @@ static int handle_tx_event(struct xhci_hcd *xhci, } /* Count current td numbers if ep->skip is set */ - if (ep->skip) { - list_for_each(tmp, &ep_ring->td_list) - td_num++; - } + if (ep->skip) + td_num += list_count(&ep_ring->td_list); /* Look for common error cases */ switch (trb_comp_code) { |