rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER
When assigning a NULL value to an RCU protected pointer, no barrier is needed. The rcu_assign_pointer, used to handle that but will soon change to not handle the special case. Convert all rcu_assign_pointer of NULL value. //smpl @@ expression P; @@ - rcu_assign_pointer(P, NULL) + RCU_INIT_POINTER(P, NULL) // </smpl> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
76f793e3a4
commit
a9b3cd7f32
@@ -231,7 +231,7 @@ static void ipip_tunnel_unlink(struct ipip_net *ipn, struct ip_tunnel *t)
|
||||
(iter = rtnl_dereference(*tp)) != NULL;
|
||||
tp = &iter->next) {
|
||||
if (t == iter) {
|
||||
rcu_assign_pointer(*tp, t->next);
|
||||
RCU_INIT_POINTER(*tp, t->next);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -241,8 +241,8 @@ static void ipip_tunnel_link(struct ipip_net *ipn, struct ip_tunnel *t)
|
||||
{
|
||||
struct ip_tunnel __rcu **tp = ipip_bucket(ipn, t);
|
||||
|
||||
rcu_assign_pointer(t->next, rtnl_dereference(*tp));
|
||||
rcu_assign_pointer(*tp, t);
|
||||
RCU_INIT_POINTER(t->next, rtnl_dereference(*tp));
|
||||
RCU_INIT_POINTER(*tp, t);
|
||||
}
|
||||
|
||||
static struct ip_tunnel * ipip_tunnel_locate(struct net *net,
|
||||
@@ -301,7 +301,7 @@ static void ipip_tunnel_uninit(struct net_device *dev)
|
||||
struct ipip_net *ipn = net_generic(net, ipip_net_id);
|
||||
|
||||
if (dev == ipn->fb_tunnel_dev)
|
||||
rcu_assign_pointer(ipn->tunnels_wc[0], NULL);
|
||||
RCU_INIT_POINTER(ipn->tunnels_wc[0], NULL);
|
||||
else
|
||||
ipip_tunnel_unlink(ipn, netdev_priv(dev));
|
||||
dev_put(dev);
|
||||
@@ -791,7 +791,7 @@ static int __net_init ipip_fb_tunnel_init(struct net_device *dev)
|
||||
return -ENOMEM;
|
||||
|
||||
dev_hold(dev);
|
||||
rcu_assign_pointer(ipn->tunnels_wc[0], tunnel);
|
||||
RCU_INIT_POINTER(ipn->tunnels_wc[0], tunnel);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user