Use list_for_each_entry() instead of list_for_each() to simplify
the code.

Signed-off-by: Geliang Tang <geliangt...@163.com>
---
 drivers/usb/host/xhci-ring.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index f1c21c4..4ed15c0 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -640,7 +640,6 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, 
int slot_id,
        unsigned int ep_index;
        struct xhci_ring *ep_ring;
        struct xhci_virt_ep *ep;
-       struct list_head *entry;
        struct xhci_td *cur_td = NULL;
        struct xhci_td *last_unlinked_td;
 
@@ -670,8 +669,7 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, 
int slot_id,
         * it.  We're also in the event handler, so we can't get re-interrupted
         * if another Stop Endpoint command completes
         */
-       list_for_each(entry, &ep->cancelled_td_list) {
-               cur_td = list_entry(entry, struct xhci_td, cancelled_td_list);
+       list_for_each_entry(cur_td, &ep->cancelled_td_list, cancelled_td_list) {
                xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
                                "Removing canceled TD starting at 0x%llx 
(dma).",
                                (unsigned long long)xhci_trb_virt_to_dma(
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to