aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/octeon-usb
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2013-10-10 20:25:34 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-11 22:46:00 (GMT)
commitf011fefa8a25980bce5f83f49d6524b3910d64aa (patch)
tree670a1c43787403dff4808d02f43d25a5561d4b90 /drivers/staging/octeon-usb
parent244544a1850a47b89f5dca4bb4d20f6800767f4e (diff)
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')
-rw-r--r--drivers/staging/octeon-usb/octeon-hcd.c5
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);
}

Privacy Policy