From: Nikolay Aleksandrov <razor@blackwall.org>
To: bpf@vger.kernel.org
Cc: jiri@resnulli.us, netdev@vger.kernel.org, martin.lau@linux.dev,
ast@kernel.org, andrii@kernel.org, john.fastabend@gmail.com,
kuba@kernel.org, andrew@lunn.ch, toke@kernel.org,
toke@redhat.com, sdf@google.com, daniel@iogearbox.net,
Nikolay Aleksandrov <razor@blackwall.org>
Subject: [PATCH bpf-next 1/2] netkit: remove explicit active/peer ptr initialization
Date: Thu, 26 Oct 2023 12:41:05 +0300 [thread overview]
Message-ID: <20231026094106.1505892-2-razor@blackwall.org> (raw)
In-Reply-To: <20231026094106.1505892-1-razor@blackwall.org>
Remove the explicit NULLing of active/peer pointers and rely on the
implicit one done at net device allocation.
Suggested-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
---
drivers/net/netkit.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/net/netkit.c b/drivers/net/netkit.c
index 7e484f9fd3ae..5a0f86f38f09 100644
--- a/drivers/net/netkit.c
+++ b/drivers/net/netkit.c
@@ -371,8 +371,6 @@ static int netkit_new_link(struct net *src_net, struct net_device *dev,
nk->policy = default_peer;
nk->mode = mode;
bpf_mprog_bundle_init(&nk->bundle);
- RCU_INIT_POINTER(nk->active, NULL);
- RCU_INIT_POINTER(nk->peer, NULL);
err = register_netdevice(peer);
put_net(net);
@@ -398,8 +396,6 @@ static int netkit_new_link(struct net *src_net, struct net_device *dev,
nk->policy = default_prim;
nk->mode = mode;
bpf_mprog_bundle_init(&nk->bundle);
- RCU_INIT_POINTER(nk->active, NULL);
- RCU_INIT_POINTER(nk->peer, NULL);
err = register_netdevice(dev);
if (err < 0)
--
2.38.1
next prev parent reply other threads:[~2023-10-26 9:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 9:41 [PATCH bpf-next 0/2] netkit: two minor cleanups Nikolay Aleksandrov
2023-10-26 9:41 ` Nikolay Aleksandrov [this message]
2023-10-26 12:12 ` [PATCH bpf-next 1/2] netkit: remove explicit active/peer ptr initialization Daniel Borkmann
2023-10-26 13:21 ` Jiri Pirko
2023-10-26 9:41 ` [PATCH bpf-next 2/2] netkit: use netlink policy for mode and policy attributes validation Nikolay Aleksandrov
2023-10-26 12:13 ` Daniel Borkmann
2023-10-26 13:23 ` Jiri Pirko
2023-10-26 14:11 ` Ido Schimmel
2023-10-26 14:23 ` Nikolay Aleksandrov
2023-10-26 14:25 ` Daniel Borkmann
2023-10-26 14:34 ` Nikolay Aleksandrov
2023-10-26 14:10 ` [PATCH bpf-next 0/2] netkit: two minor cleanups patchwork-bot+netdevbpf
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=20231026094106.1505892-2-razor@blackwall.org \
--to=razor@blackwall.org \
--cc=andrew@lunn.ch \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=sdf@google.com \
--cc=toke@kernel.org \
--cc=toke@redhat.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