Use list_for_each_entry_safe() instead of list_for_each_safe() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@xxxxxxx> --- 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-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html