Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964909AbbLRQh4 (ORCPT ); Fri, 18 Dec 2015 11:37:56 -0500 Received: from m50-132.163.com ([123.125.50.132]:44060 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932999AbbLRQfl (ORCPT ); Fri, 18 Dec 2015 11:35:41 -0500 From: Geliang Tang To: Mathias Nyman , Greg Kroah-Hartman Cc: Geliang Tang , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/9] usb: xhci: use list_for_each_entry Date: Sat, 19 Dec 2015 00:34:30 +0800 Message-Id: <0fbea26fdbcb76e24188fc0800d425f927f45b6f.1450455485.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: DNGowECJ_kilNXRW6RsBAA--.504S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7KrW3Wr48Wr15Cr47tryDtrb_yoW8JFy7pF W5C347Cr4rta1fW3Z8AFyrAF15Za1qg39Fyry2k3yYgr4qyF4jga4ak3WFgry3WrWkuw1a vr4UtrW5CwsrJFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U5GYXUUUUU= X-Originating-IP: [116.77.150.30] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiJQbUmVUL85N2nAAAs6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1482 Lines: 39 Use list_for_each_entry() instead of list_for_each() to simplify the code. Signed-off-by: Geliang Tang --- drivers/usb/host/xhci-ring.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index f1c21c4..4ed15c0 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -640,7 +640,6 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id, unsigned int ep_index; struct xhci_ring *ep_ring; struct xhci_virt_ep *ep; - struct list_head *entry; struct xhci_td *cur_td = NULL; struct xhci_td *last_unlinked_td; @@ -670,8 +669,7 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id, * it. We're also in the event handler, so we can't get re-interrupted * if another Stop Endpoint command completes */ - list_for_each(entry, &ep->cancelled_td_list) { - cur_td = list_entry(entry, struct xhci_td, cancelled_td_list); + list_for_each_entry(cur_td, &ep->cancelled_td_list, cancelled_td_list) { xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, "Removing canceled TD starting at 0x%llx (dma).", (unsigned long long)xhci_trb_virt_to_dma( -- 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/