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


Groups > linux.kernel > #1295009

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

From Geliang Tang <geliangtang@163.com>
Newsgroups linux.kernel
Subject [PATCH 7/9] usb: dwc2: host: use list_for_each_entry_safe
Date 2015-12-18 17:40 +0100
Message-ID <qH6et-82w-1@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_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/

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


Thread

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

csiph-web