Commit 32540ba2 authored by Geliang Tang's avatar Geliang Tang Committed by Greg Kroah-Hartman

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: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4e5d7a82
...@@ -172,7 +172,6 @@ static int ci_requests_show(struct seq_file *s, void *data) ...@@ -172,7 +172,6 @@ static int ci_requests_show(struct seq_file *s, void *data)
{ {
struct ci_hdrc *ci = s->private; struct ci_hdrc *ci = s->private;
unsigned long flags; unsigned long flags;
struct list_head *ptr = NULL;
struct ci_hw_req *req = NULL; struct ci_hw_req *req = NULL;
struct td_node *node, *tmpnode; struct td_node *node, *tmpnode;
unsigned i, j, qsize = sizeof(struct ci_hw_td)/sizeof(u32); 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) ...@@ -184,9 +183,7 @@ static int ci_requests_show(struct seq_file *s, void *data)
spin_lock_irqsave(&ci->lock, flags); spin_lock_irqsave(&ci->lock, flags);
for (i = 0; i < ci->hw_ep_max; i++) for (i = 0; i < ci->hw_ep_max; i++)
list_for_each(ptr, &ci->ci_hw_ep[i].qh.queue) { list_for_each_entry(req, &ci->ci_hw_ep[i].qh.queue, queue) {
req = list_entry(ptr, struct ci_hw_req, queue);
list_for_each_entry_safe(node, tmpnode, &req->tds, td) { list_for_each_entry_safe(node, tmpnode, &req->tds, td) {
seq_printf(s, "EP=%02i: TD=%08X %s\n", seq_printf(s, "EP=%02i: TD=%08X %s\n",
i % (ci->hw_ep_max / 2), i % (ci->hw_ep_max / 2),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment