From: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Monam Agarwal
<monamagarwal123-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH net-next 12/12] net/openvswitch: Use with RCU_INIT_POINTER(x, NULL) in vport-gre.c
Date: Fri, 16 May 2014 14:07:39 -0700 [thread overview]
Message-ID: <1400274459-56304-13-git-send-email-jesse@nicira.com> (raw)
In-Reply-To: <1400274459-56304-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
From: Monam Agarwal <monamagarwal123-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)
The rcu_assign_pointer() ensures that the initialization of a structure
is carried out before storing a pointer to that structure.
And in the case of the NULL pointer, there is no structure to initialize.
So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)
Signed-off-by: Monam Agarwal <monamagarwal123-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/vport-gre.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
index 0856f01..35ec4fe 100644
--- a/net/openvswitch/vport-gre.c
+++ b/net/openvswitch/vport-gre.c
@@ -256,7 +256,7 @@ static void gre_tnl_destroy(struct vport *vport)
ovs_net = net_generic(net, ovs_net_id);
- rcu_assign_pointer(ovs_net->vport_net.gre_vport, NULL);
+ RCU_INIT_POINTER(ovs_net->vport_net.gre_vport, NULL);
ovs_vport_deferred_free(vport);
gre_exit();
}
--
1.9.1
next prev parent reply other threads:[~2014-05-16 21:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 21:07 [GIT net-next] Open vSwitch Jesse Gross
[not found] ` <1400274459-56304-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2014-05-16 21:07 ` [PATCH net-next 01/12] openvswitch: use const in some local vars and casts Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 02/12] openvswitch: avoid warnings in vport_from_priv Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 03/12] openvswitch: avoid cast-qual warning in vport_priv Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 04/12] openvswitch: Added (unsigned long long) cast in printf Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 05/12] openvswitch: Use net_ratelimit in OVS_NLERR Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 06/12] openvswitch: flow_netlink: Use pr_fmt to OVS_NLERR output Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 07/12] openvswitch: Use ether_addr_copy Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 08/12] openvswitch: Remove 5-tuple optimization Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 09/12] openvswitch: Per NUMA node flow stats Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 10/12] openvswitch: Fix output of SCTP mask Jesse Gross
2014-05-16 21:07 ` [PATCH net-next 11/12] openvswitch: Use TCP flags in the flow key for stats Jesse Gross
2014-05-16 21:07 ` Jesse Gross [this message]
2014-05-16 21:22 ` [GIT net-next] Open vSwitch David Miller
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=1400274459-56304-13-git-send-email-jesse@nicira.com \
--to=jesse-l0m0p4e3n4lqt0dzr+alfa@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
--cc=monamagarwal123-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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).