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
@@ -760,7 +760,7 @@ int __netpoll_setup(struct netpoll *np)
|
||||
}
|
||||
|
||||
/* last thing to do is link it to the net device structure */
|
||||
rcu_assign_pointer(ndev->npinfo, npinfo);
|
||||
RCU_INIT_POINTER(ndev->npinfo, npinfo);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -901,7 +901,7 @@ void __netpoll_cleanup(struct netpoll *np)
|
||||
if (ops->ndo_netpoll_cleanup)
|
||||
ops->ndo_netpoll_cleanup(np->dev);
|
||||
|
||||
rcu_assign_pointer(np->dev->npinfo, NULL);
|
||||
RCU_INIT_POINTER(np->dev->npinfo, NULL);
|
||||
|
||||
/* avoid racing with NAPI reading npinfo */
|
||||
synchronize_rcu_bh();
|
||||
|
Reference in New Issue
Block a user