Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295017

[PATCH 5/9] usb: xhci: use list_for_each_entry

From Geliang Tang <geliangtang@163.com>
Newsgroups linux.kernel
Subject [PATCH 5/9] usb: xhci: use list_for_each_entry
Date 2015-12-18 17:40 +0100
Message-ID <qH6ev-82w-33@gated-at.bofh.it> (permalink)
References <qH6et-82w-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Signed-off-by: Geliang Tang <geliangtang@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-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/9] usb: host: fotg210: use list_for_each_entry_safe Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
  [PATCH 6/9] usb: chipidea: debug: use list_for_each_entry Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
    Re: [PATCH 6/9] usb: chipidea: debug: use list_for_each_entry Peter Chen <hzpeterchen@gmail.com> - 2015-12-25 08:50 +0100
  [PATCH 5/9] usb: xhci: use list_for_each_entry Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
  [PATCH 3/9] usb: host: oxu210hp-hcd: use list_for_each_entry_safe Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
  [PATCH 4/9] usb: host: u132-hcd: use list_for_each_entry Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
  [PATCH 8/9] usb: gadget: rndis: use list_for_each_entry_safe Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
    Re: [PATCH 8/9] usb: gadget: rndis: use list_for_each_entry_safe Felipe Balbi <balbi@ti.com> - 2015-12-22 19:10 +0100
      [PATCH 8/9 v2] usb: gadget: rndis: use list_for_each_entry_safe Geliang Tang <geliangtang@163.com> - 2015-12-23 15:00 +0100

csiph-web