netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: netdev@vger.kernel.org, gregkh@linuxfoundation.org,
	jirislaby@kernel.org, benjamin.tissoires@redhat.com,
	Karsten Keil <isdn@linux-pingi.de>
Subject: Re: [PATCH -next] isdn: capi, Use list_for_each_entry() helper
Date: Wed, 30 Aug 2023 11:42:30 +0200	[thread overview]
Message-ID: <ZO8PBojBX7trfVnU@localhost.localdomain> (raw)
In-Reply-To: <20230830090529.529209-1-ruanjinjie@huawei.com>

On Wed, Aug 30, 2023 at 05:05:28PM +0800, Jinjie Ruan wrote:
> Convert list_for_each() to list_for_each_entry() so that the l
> list_head pointer and list_entry() call are no longer needed, which
> can reduce a few lines of code. No functional changed.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
>  drivers/isdn/capi/capi.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
> index 2f3789515445..6664eb3dc35c 100644
> --- a/drivers/isdn/capi/capi.c
> +++ b/drivers/isdn/capi/capi.c
> @@ -1326,11 +1326,9 @@ static inline void capinc_tty_exit(void) { }
>  static int __maybe_unused capi20_proc_show(struct seq_file *m, void *v)
>  {
>  	struct capidev *cdev;
> -	struct list_head *l;
>  
>  	mutex_lock(&capidev_list_lock);
> -	list_for_each(l, &capidev_list) {
> -		cdev = list_entry(l, struct capidev, list);
> +	list_for_each_entry(cdev, &capidev_list, list) {
>  		seq_printf(m, "0 %d %lu %lu %lu %lu\n",
>  			   cdev->ap.applid,
>  			   cdev->ap.nrecvctlpkt,
> -- 
> 2.34.1

Probably { } aren't needed now.
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

  reply	other threads:[~2023-08-30  9:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30  9:05 [PATCH -next] isdn: capi, Use list_for_each_entry() helper Jinjie Ruan
2023-08-30  9:42 ` Michal Swiatkowski [this message]
2023-08-31  1:29 ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZO8PBojBX7trfVnU@localhost.localdomain \
    --to=michal.swiatkowski@linux.intel.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=isdn@linux-pingi.de \
    --cc=jirislaby@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ruanjinjie@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).