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


Groups > linux.kernel > #1295009 > unrolled thread

[PATCH 7/9] usb: dwc2: host: use list_for_each_entry_safe

Started byGeliang Tang <geliangtang@163.com>
First post2015-12-18 17:40 +0100
Last post2015-12-18 17:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 7/9] usb: dwc2: host: use list_for_each_entry_safe Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100

#1295009 — [PATCH 7/9] usb: dwc2: host: use list_for_each_entry_safe

FromGeliang Tang <geliangtang@163.com>
Date2015-12-18 17:40 +0100
Subject[PATCH 7/9] usb: dwc2: host: use list_for_each_entry_safe
Message-ID<qH6et-82w-1@gated-at.bofh.it>
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/dwc2/hcd_ddma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c
index 36606fc..14e004d 100644
--- a/drivers/usb/dwc2/hcd_ddma.c
+++ b/drivers/usb/dwc2/hcd_ddma.c
@@ -1222,9 +1222,8 @@ static void dwc2_complete_non_isoc_xfer_ddma(struct dwc2_hsotg *hsotg,
 					     int chnum,
 					     enum dwc2_halt_status halt_status)
 {
-	struct list_head *qtd_item, *qtd_tmp;
 	struct dwc2_qh *qh = chan->qh;
-	struct dwc2_qtd *qtd = NULL;
+	struct dwc2_qtd *qtd = NULL, *tmp;
 	int xfer_done;
 	int desc_num = 0;
 
@@ -1234,10 +1233,9 @@ static void dwc2_complete_non_isoc_xfer_ddma(struct dwc2_hsotg *hsotg,
 		return;
 	}
 
-	list_for_each_safe(qtd_item, qtd_tmp, &qh->qtd_list) {
+	list_for_each_entry_safe(qtd, tmp, &qh->qtd_list, qtd_list_entry) {
 		int i;
 
-		qtd = list_entry(qtd_item, struct dwc2_qtd, qtd_list_entry);
 		xfer_done = 0;
 
 		for (i = 0; i < qtd->n_desc; i++) {
-- 
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/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web