netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Hongbo Li <lihongbo22@huawei.com>
Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, jmaloy@redhat.com,
	ying.xue@windriver.com, pablo@netfilter.org,
	kadlec@netfilter.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH net-next 2/5] net/tipc: make use of the helper macro LIST_HEAD()
Date: Tue, 27 Aug 2024 17:57:23 +0100	[thread overview]
Message-ID: <20240827165723.GQ1368797@kernel.org> (raw)
In-Reply-To: <20240827100407.3914090-3-lihongbo22@huawei.com>

On Tue, Aug 27, 2024 at 06:04:04PM +0800, Hongbo Li wrote:
> list_head can be initialized automatically with LIST_HEAD()
> instead of calling INIT_LIST_HEAD(). Here we can simplify
> the code.
> 
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
> ---
>  net/tipc/socket.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/net/tipc/socket.c b/net/tipc/socket.c
> index 1a0cd06f0eae..9d30e362392c 100644
> --- a/net/tipc/socket.c
> +++ b/net/tipc/socket.c
> @@ -1009,12 +1009,11 @@ static int tipc_send_group_anycast(struct socket *sock, struct msghdr *m,
>  	struct tipc_member *mbr = NULL;
>  	struct net *net = sock_net(sk);
>  	u32 node, port, exclude;
> -	struct list_head dsts;
>  	int lookups = 0;
>  	int dstcnt, rc;
>  	bool cong;
> +	LIST_HEAD(dsts);

nit: Please place this new line where the old dsts line was,
     in order to preserve, within the context of this hunk,
     reverse xmas tree order - longest line to shortest -
     for local variable declarations.

>  
> -	INIT_LIST_HEAD(&dsts);
>  	ua->sa.type = msg_nametype(hdr);
>  	ua->scope = msg_lookup_scope(hdr);
>  
> @@ -1161,10 +1160,9 @@ static int tipc_send_group_mcast(struct socket *sock, struct msghdr *m,
>  	struct tipc_group *grp = tsk->group;
>  	struct tipc_msg *hdr = &tsk->phdr;
>  	struct net *net = sock_net(sk);
> -	struct list_head dsts;
>  	u32 dstcnt, exclude;
> +	LIST_HEAD(dsts);
>  
> -	INIT_LIST_HEAD(&dsts);
>  	ua->sa.type = msg_nametype(hdr);
>  	ua->scope = msg_lookup_scope(hdr);
>  	exclude = tipc_group_exclude(grp);

-- 
pw-bot: cr

  reply	other threads:[~2024-08-27 16:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 10:04 [PATCH net-next 0/5] make use of the helper macro LIST_HEAD() Hongbo Li
2024-08-27 10:04 ` [PATCH net-next 1/5] net/ipv4: " Hongbo Li
2024-08-27 10:04 ` [PATCH net-next 2/5] net/tipc: " Hongbo Li
2024-08-27 16:57   ` Simon Horman [this message]
2024-08-30  1:17     ` Hongbo Li
2024-08-27 10:04 ` [PATCH net-next 3/5] net/netfilter: " Hongbo Li
2024-08-27 16:15   ` Pablo Neira Ayuso
2024-08-28  1:35     ` Hongbo Li
2024-08-28  6:52       ` Pablo Neira Ayuso
2024-08-27 10:04 ` [PATCH net-next 4/5] net/ipv6: " Hongbo Li
2024-08-27 10:04 ` [PATCH net-next 5/5] net/core: " Hongbo Li

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=20240827165723.GQ1368797@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=jmaloy@redhat.com \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=lihongbo22@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=ying.xue@windriver.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).