Skip to content

Commit

Permalink
usb: gadget: bcm63xx_udc: use list_for_each_entry_safe
Browse files Browse the repository at this point in the history
Use list_for_each_entry_safe() instead of list_for_each_safe() to
simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Geliang Tang authored and Felipe Balbi committed Dec 22, 2015
1 parent 39cee20 commit ea4a8cb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/usb/gadget/udc/bcm63xx_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep)
struct bcm63xx_ep *bep = our_ep(ep);
struct bcm63xx_udc *udc = bep->udc;
struct iudma_ch *iudma = bep->iudma;
struct list_head *pos, *n;
struct bcm63xx_req *breq, *n;
unsigned long flags;

if (!ep || !ep->desc)
Expand All @@ -1099,10 +1099,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep)
iudma_reset_channel(udc, iudma);

if (!list_empty(&bep->queue)) {
list_for_each_safe(pos, n, &bep->queue) {
struct bcm63xx_req *breq =
list_entry(pos, struct bcm63xx_req, queue);

list_for_each_entry_safe(breq, n, &bep->queue, queue) {
usb_gadget_unmap_request(&udc->gadget, &breq->req,
iudma->is_tx);
list_del(&breq->queue);
Expand Down

0 comments on commit ea4a8cb

Please sign in to comment.