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
@@ -679,7 +679,7 @@ int pn_sock_bind_res(struct sock *sk, u8 res)
|
||||
mutex_lock(&resource_mutex);
|
||||
if (pnres.sk[res] == NULL) {
|
||||
sock_hold(sk);
|
||||
rcu_assign_pointer(pnres.sk[res], sk);
|
||||
RCU_INIT_POINTER(pnres.sk[res], sk);
|
||||
ret = 0;
|
||||
}
|
||||
mutex_unlock(&resource_mutex);
|
||||
@@ -695,7 +695,7 @@ int pn_sock_unbind_res(struct sock *sk, u8 res)
|
||||
|
||||
mutex_lock(&resource_mutex);
|
||||
if (pnres.sk[res] == sk) {
|
||||
rcu_assign_pointer(pnres.sk[res], NULL);
|
||||
RCU_INIT_POINTER(pnres.sk[res], NULL);
|
||||
ret = 0;
|
||||
}
|
||||
mutex_unlock(&resource_mutex);
|
||||
@@ -714,7 +714,7 @@ void pn_sock_unbind_all_res(struct sock *sk)
|
||||
mutex_lock(&resource_mutex);
|
||||
for (res = 0; res < 256; res++) {
|
||||
if (pnres.sk[res] == sk) {
|
||||
rcu_assign_pointer(pnres.sk[res], NULL);
|
||||
RCU_INIT_POINTER(pnres.sk[res], NULL);
|
||||
match++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user