Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933217AbbLRQh6 (ORCPT ); Fri, 18 Dec 2015 11:37:58 -0500 Received: from m50-135.163.com ([123.125.50.135]:44727 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932788AbbLRQfk (ORCPT ); Fri, 18 Dec 2015 11:35:40 -0500 From: Geliang Tang To: Kevin Cernekee , Felipe Balbi , Greg Kroah-Hartman Cc: Geliang Tang , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 9/9] usb: gadget: bcm63xx_udc: use list_for_each_entry_safe Date: Sat, 19 Dec 2015 00:34:34 +0800 Message-Id: <47700828d7fee6b8d74426258fa424bedc71d37a.1450455486.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1ec91b8ad8d81a446e08f3c4f15f2d3df620b186.1450455485.git.geliangtang@163.com> References: <1ec91b8ad8d81a446e08f3c4f15f2d3df620b186.1450455485.git.geliangtang@163.com> In-Reply-To: <1ec91b8ad8d81a446e08f3c4f15f2d3df620b186.1450455485.git.geliangtang@163.com> References: <1ec91b8ad8d81a446e08f3c4f15f2d3df620b186.1450455485.git.geliangtang@163.com> X-CM-TRANSID: D9GowABX_zGsNXRWoRCmAw--.26230S3 X-Coremail-Antispam: 1Uf129KBjvJXoWrtryUZr43Gw1xuFWkCryUJrb_yoW8Jry5pF 4rC342yrWkZ39a9F4UG3WDZFZ8Zrsxt3409FWIk3Z5XF15tr4xXryfJa4SqrWSyFW8Ar4a 9F4qkrn5J3WUGw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UfkuxUUUUU= X-Originating-IP: [116.77.150.30] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiMA3UmVWBTMeG1wAAs+ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1434 Lines: 42 Use list_for_each_entry_safe() instead of list_for_each_safe() to simplify the code. Signed-off-by: Geliang Tang --- drivers/usb/gadget/udc/bcm63xx_udc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index 8cbb003..f5fccb3 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -1083,7 +1083,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep) struct bcm63xx_ep *bep = our_ep(ep); struct bcm63xx_udc *udc = bep->udc; struct iudma_ch *iudma = bep->iudma; - struct list_head *pos, *n; + struct bcm63xx_req *breq, *n; unsigned long flags; if (!ep || !ep->desc) @@ -1099,10 +1099,7 @@ static int bcm63xx_ep_disable(struct usb_ep *ep) iudma_reset_channel(udc, iudma); if (!list_empty(&bep->queue)) { - list_for_each_safe(pos, n, &bep->queue) { - struct bcm63xx_req *breq = - list_entry(pos, struct bcm63xx_req, queue); - + list_for_each_entry_safe(breq, n, &bep->queue, queue) { usb_gadget_unmap_request(&udc->gadget, &breq->req, iudma->is_tx); list_del(&breq->queue); -- 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/