mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
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 <mathias.nyman@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20221123144901.40493-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c2d9d02f7b
commit
b47ec9727f
1 changed files with 2 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue