Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1298095

Re: [PATCH 6/9] usb: chipidea: debug: use list_for_each_entry

From Peter Chen <hzpeterchen@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 6/9] usb: chipidea: debug: use list_for_each_entry
Date 2015-12-25 08:50 +0100
Message-ID <qJviq-EO-3@gated-at.bofh.it> (permalink)
References <qH6et-82w-3@gated-at.bofh.it> <qH6eu-82w-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Dec 19, 2015 at 12:34:31AM +0800, Geliang Tang wrote:
> Use list_for_each_entry() instead of list_for_each() to simplify
> the code.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  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
> 

It is ok for chipidea part, I will queue it, you don't need to
re-send it again

-- 

Best Regards,
Peter Chen
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/9] usb: host: fotg210: use list_for_each_entry_safe Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
  [PATCH 6/9] usb: chipidea: debug: use list_for_each_entry Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
    Re: [PATCH 6/9] usb: chipidea: debug: use list_for_each_entry Peter Chen <hzpeterchen@gmail.com> - 2015-12-25 08:50 +0100
  [PATCH 5/9] usb: xhci: use list_for_each_entry Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
  [PATCH 3/9] usb: host: oxu210hp-hcd: use list_for_each_entry_safe Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
  [PATCH 4/9] usb: host: u132-hcd: use list_for_each_entry Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
  [PATCH 8/9] usb: gadget: rndis: use list_for_each_entry_safe Geliang Tang <geliangtang@163.com> - 2015-12-18 17:40 +0100
    Re: [PATCH 8/9] usb: gadget: rndis: use list_for_each_entry_safe Felipe Balbi <balbi@ti.com> - 2015-12-22 19:10 +0100
      [PATCH 8/9 v2] usb: gadget: rndis: use list_for_each_entry_safe Geliang Tang <geliangtang@163.com> - 2015-12-23 15:00 +0100

csiph-web