public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/9] usb: host: fotg210: use list_for_each_entry_safe
@ 2015-12-18 16:34 Geliang Tang
  2015-12-18 16:34 ` [PATCH 2/9] usb: host: max3421-hcd: use list_for_each_entry* Geliang Tang
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Geliang Tang @ 2015-12-18 16:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Peter Senna Tschudin, Sergei Shtylyov
  Cc: Geliang Tang, linux-usb, linux-kernel

Use list_for_each_entry_safe() instead of list_for_each_safe() to
simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/usb/host/fotg210-hcd.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
index 2341af4..360a5e9 100644
--- a/drivers/usb/host/fotg210-hcd.c
+++ b/drivers/usb/host/fotg210-hcd.c
@@ -2267,7 +2267,7 @@ static unsigned qh_completions(struct fotg210_hcd *fotg210,
 		struct fotg210_qh *qh)
 {
 	struct fotg210_qtd *last, *end = qh->dummy;
-	struct list_head *entry, *tmp;
+	struct fotg210_qtd *qtd, *tmp;
 	int last_status;
 	int stopped;
 	unsigned count = 0;
@@ -2301,12 +2301,10 @@ rescan:
 	 * then let the queue advance.
 	 * if queue is stopped, handles unlinks.
 	 */
-	list_for_each_safe(entry, tmp, &qh->qtd_list) {
-		struct fotg210_qtd *qtd;
+	list_for_each_entry_safe(qtd, tmp, &qh->qtd_list, qtd_list) {
 		struct urb *urb;
 		u32 token = 0;
 
-		qtd = list_entry(entry, struct fotg210_qtd, qtd_list);
 		urb = qtd->urb;
 
 		/* clean up any state from previous QTD ...*/
@@ -2544,14 +2542,11 @@ retry_xacterr:
  * used for cleanup after errors, before HC sees an URB's TDs.
  */
 static void qtd_list_free(struct fotg210_hcd *fotg210, struct urb *urb,
-		struct list_head *qtd_list)
+		struct list_head *head)
 {
-	struct list_head *entry, *temp;
-
-	list_for_each_safe(entry, temp, qtd_list) {
-		struct fotg210_qtd *qtd;
+	struct fotg210_qtd *qtd, *temp;
 
-		qtd = list_entry(entry, struct fotg210_qtd, qtd_list);
+	list_for_each_entry_safe(qtd, temp, head, qtd_list) {
 		list_del(&qtd->qtd_list);
 		fotg210_qtd_free(fotg210, qtd);
 	}
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-12-25  7:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-18 16:34 [PATCH 1/9] usb: host: fotg210: use list_for_each_entry_safe Geliang Tang
2015-12-18 16:34 ` [PATCH 2/9] usb: host: max3421-hcd: use list_for_each_entry* Geliang Tang
2015-12-18 16:34 ` [PATCH 3/9] usb: host: oxu210hp-hcd: use list_for_each_entry_safe Geliang Tang
2015-12-18 16:34 ` [PATCH 4/9] usb: host: u132-hcd: use list_for_each_entry Geliang Tang
2015-12-18 16:34 ` [PATCH 5/9] usb: xhci: " Geliang Tang
2015-12-18 16:34 ` [PATCH 6/9] usb: chipidea: debug: " Geliang Tang
2015-12-25  7:41   ` Peter Chen
2015-12-18 16:34 ` [PATCH 7/9] usb: dwc2: host: use list_for_each_entry_safe Geliang Tang
2015-12-18 16:34 ` [PATCH 8/9] usb: gadget: rndis: " Geliang Tang
2015-12-22 18:07   ` Felipe Balbi
2015-12-23 13:51     ` [PATCH 8/9 v2] " Geliang Tang
2015-12-18 16:34 ` [PATCH 9/9] usb: gadget: bcm63xx_udc: " Geliang Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox