diff options
author | Geliang Tang <geliangtang@163.com> | 2015-12-18 11:34:31 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-01-24 23:55:33 -0500 |
commit | 32540ba237411244f04ef783bf0fa61041ab592d (patch) | |
tree | be5d95719ee0e44d14adc9377965856c14840c7c /drivers/usb/chipidea | |
parent | 4e5d7a82d3acf8b53f3d72153de142c0ab608b56 (diff) |
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')
-rw-r--r-- | drivers/usb/chipidea/debug.c | 5 |
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) | |||
172 | { | 172 | { |
173 | struct ci_hdrc *ci = s->private; | 173 | struct ci_hdrc *ci = s->private; |
174 | unsigned long flags; | 174 | unsigned long flags; |
175 | struct list_head *ptr = NULL; | ||
176 | struct ci_hw_req *req = NULL; | 175 | struct ci_hw_req *req = NULL; |
177 | struct td_node *node, *tmpnode; | 176 | struct td_node *node, *tmpnode; |
178 | unsigned i, j, qsize = sizeof(struct ci_hw_td)/sizeof(u32); | 177 | 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 | 183 | ||
185 | spin_lock_irqsave(&ci->lock, flags); | 184 | spin_lock_irqsave(&ci->lock, flags); |
186 | for (i = 0; i < ci->hw_ep_max; i++) | 185 | for (i = 0; i < ci->hw_ep_max; i++) |
187 | list_for_each(ptr, &ci->ci_hw_ep[i].qh.queue) { | 186 | list_for_each_entry(req, &ci->ci_hw_ep[i].qh.queue, queue) { |
188 | req = list_entry(ptr, struct ci_hw_req, queue); | ||
189 | |||
190 | list_for_each_entry_safe(node, tmpnode, &req->tds, td) { | 187 | list_for_each_entry_safe(node, tmpnode, &req->tds, td) { |
191 | seq_printf(s, "EP=%02i: TD=%08X %s\n", | 188 | seq_printf(s, "EP=%02i: TD=%08X %s\n", |
192 | i % (ci->hw_ep_max / 2), | 189 | i % (ci->hw_ep_max / 2), |