diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2013-10-10 20:25:34 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-11 22:46:00 (GMT) |
commit | f011fefa8a25980bce5f83f49d6524b3910d64aa (patch) | |
tree | 670a1c43787403dff4808d02f43d25a5561d4b90 /drivers/staging/octeon-usb/octeon-hcd.c | |
parent | 244544a1850a47b89f5dca4bb4d20f6800767f4e (diff) | |
download | linux-f011fefa8a25980bce5f83f49d6524b3910d64aa.tar.xz |
staging: octeon-usb: use list_for_each_entry_safe()
Use list_for_each_entry_safe() when deleting all list items.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/octeon-usb/octeon-hcd.c')
-rw-r--r-- | drivers/staging/octeon-usb/octeon-hcd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c index 632190a..8e0fcbd 100644 --- a/drivers/staging/octeon-usb/octeon-hcd.c +++ b/drivers/staging/octeon-usb/octeon-hcd.c @@ -3223,13 +3223,14 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, static void octeon_usb_urb_dequeue_work(unsigned long arg) { + struct urb *urb; + struct urb *next; unsigned long flags; struct octeon_hcd *priv = (struct octeon_hcd *)arg; spin_lock_irqsave(&priv->lock, flags); - while (!list_empty(&priv->dequeue_list)) { - struct urb *urb = container_of(priv->dequeue_list.next, struct urb, urb_list); + list_for_each_entry_safe(urb, next, &priv->dequeue_list, urb_list) { list_del_init(&urb->urb_list); cvmx_usb_cancel(&priv->usb, urb->ep->hcpriv, urb->hcpriv); } |