mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-22 07:53:11 -05:00
net/tipc: make use of the helper macro LIST_HEAD()
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> Link: https://patch.msgid.link/20240904093243.3345012-3-lihongbo22@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
cecbe5c8c8
commit
e636ba1a15
1 changed files with 2 additions and 4 deletions
|
@ -1009,12 +1009,11 @@ static int tipc_send_group_anycast(struct socket *sock, struct msghdr *m,
|
||||||
struct tipc_member *mbr = NULL;
|
struct tipc_member *mbr = NULL;
|
||||||
struct net *net = sock_net(sk);
|
struct net *net = sock_net(sk);
|
||||||
u32 node, port, exclude;
|
u32 node, port, exclude;
|
||||||
struct list_head dsts;
|
LIST_HEAD(dsts);
|
||||||
int lookups = 0;
|
int lookups = 0;
|
||||||
int dstcnt, rc;
|
int dstcnt, rc;
|
||||||
bool cong;
|
bool cong;
|
||||||
|
|
||||||
INIT_LIST_HEAD(&dsts);
|
|
||||||
ua->sa.type = msg_nametype(hdr);
|
ua->sa.type = msg_nametype(hdr);
|
||||||
ua->scope = msg_lookup_scope(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_group *grp = tsk->group;
|
||||||
struct tipc_msg *hdr = &tsk->phdr;
|
struct tipc_msg *hdr = &tsk->phdr;
|
||||||
struct net *net = sock_net(sk);
|
struct net *net = sock_net(sk);
|
||||||
struct list_head dsts;
|
|
||||||
u32 dstcnt, exclude;
|
u32 dstcnt, exclude;
|
||||||
|
LIST_HEAD(dsts);
|
||||||
|
|
||||||
INIT_LIST_HEAD(&dsts);
|
|
||||||
ua->sa.type = msg_nametype(hdr);
|
ua->sa.type = msg_nametype(hdr);
|
||||||
ua->scope = msg_lookup_scope(hdr);
|
ua->scope = msg_lookup_scope(hdr);
|
||||||
exclude = tipc_group_exclude(grp);
|
exclude = tipc_group_exclude(grp);
|
||||||
|
|
Loading…
Reference in a new issue