summaryrefslogtreecommitdiff
path: root/drivers/usb/chipidea/debug.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-18 19:34:31 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-25 07:55:33 +0300
commit32540ba237411244f04ef783bf0fa61041ab592d (patch)
treebe5d95719ee0e44d14adc9377965856c14840c7c /drivers/usb/chipidea/debug.c
parent4e5d7a82d3acf8b53f3d72153de142c0ab608b56 (diff)
downloadlinux-32540ba237411244f04ef783bf0fa61041ab592d.tar.xz
usb: chipidea: debug: use list_for_each_entry
Use list_for_each_entry() instead of list_for_each() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/debug.c')
-rw-r--r--drivers/usb/chipidea/debug.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index a4f7db2e18dd..de5c5092d078 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),