Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933142AbbLRQf4 (ORCPT ); Fri, 18 Dec 2015 11:35:56 -0500 Received: from m50-138.163.com ([123.125.50.138]:54505 "EHLO m50-138.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933102AbbLRQfx (ORCPT ); Fri, 18 Dec 2015 11:35:53 -0500 From: Geliang Tang To: Peter Chen , Greg Kroah-Hartman Cc: Geliang Tang , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/9] usb: chipidea: debug: use list_for_each_entry Date: Sat, 19 Dec 2015 00:34:31 +0800 Message-Id: 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: C9GowADnFsWnNXRWiJ+pAA--.56458S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7GF4rWF48GFWfCr48WF1kuFg_yoWkKFb_Cr yxXFn7Cr4UKF4rKr4vg3s3XrZxC3WjgFsY9Fsaqry3JF15CrWrZFWjqrZ5Wa4Uuw4ktF93 G3WkX3y5uw1qvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUgyZUUUUUU== X-Originating-IP: [116.77.150.30] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiowjUmVUL3ca6iQAAsQ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1419 Lines: 40 Use list_for_each_entry() instead of list_for_each() to simplify the code. Signed-off-by: Geliang Tang --- drivers/usb/chipidea/debug.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c index a4f7db2..de5c509 100644 --- a/drivers/usb/chipidea/debug.c +++ b/drivers/usb/chipidea/debug.c @@ -172,7 +172,6 @@ static int ci_requests_show(struct seq_file *s, void *data) { struct ci_hdrc *ci = s->private; unsigned long flags; - struct list_head *ptr = NULL; struct ci_hw_req *req = NULL; struct td_node *node, *tmpnode; unsigned i, j, qsize = sizeof(struct ci_hw_td)/sizeof(u32); @@ -184,9 +183,7 @@ static int ci_requests_show(struct seq_file *s, void *data) spin_lock_irqsave(&ci->lock, flags); for (i = 0; i < ci->hw_ep_max; i++) - list_for_each(ptr, &ci->ci_hw_ep[i].qh.queue) { - req = list_entry(ptr, struct ci_hw_req, queue); - + list_for_each_entry(req, &ci->ci_hw_ep[i].qh.queue, queue) { list_for_each_entry_safe(node, tmpnode, &req->tds, td) { seq_printf(s, "EP=%02i: TD=%08X %s\n", i % (ci->hw_ep_max / 2), -- 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/