Skip to content

Commit

Permalink
usb: chipidea: debug: use list_for_each_entry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geliang Tang authored and Greg Kroah-Hartman committed Jan 25, 2016
1 parent 4e5d7a8 commit 32540ba
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/usb/chipidea/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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),
Expand Down

0 comments on commit 32540ba

Please sign in to comment.