diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-08-01 12:19:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-02 07:29:23 -0400 |
commit | a9b3cd7f323b2e57593e7215362a7b02fc933e3a (patch) | |
tree | eba1741956aef3015d5b1a07253bf93c4c1bc7df /net/phonet/socket.c | |
parent | 76f793e3a47139d340185cbc1a314740c09b13d3 (diff) |
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>
Diffstat (limited to 'net/phonet/socket.c')
-rw-r--r-- | net/phonet/socket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/phonet/socket.c b/net/phonet/socket.c index ab07711cf2f4..676d18dc75b7 100644 --- a/net/phonet/socket.c +++ b/net/phonet/socket.c | |||
@@ -679,7 +679,7 @@ int pn_sock_bind_res(struct sock *sk, u8 res) | |||
679 | mutex_lock(&resource_mutex); | 679 | mutex_lock(&resource_mutex); |
680 | if (pnres.sk[res] == NULL) { | 680 | if (pnres.sk[res] == NULL) { |
681 | sock_hold(sk); | 681 | sock_hold(sk); |
682 | rcu_assign_pointer(pnres.sk[res], sk); | 682 | RCU_INIT_POINTER(pnres.sk[res], sk); |
683 | ret = 0; | 683 | ret = 0; |
684 | } | 684 | } |
685 | mutex_unlock(&resource_mutex); | 685 | mutex_unlock(&resource_mutex); |
@@ -695,7 +695,7 @@ int pn_sock_unbind_res(struct sock *sk, u8 res) | |||
695 | 695 | ||
696 | mutex_lock(&resource_mutex); | 696 | mutex_lock(&resource_mutex); |
697 | if (pnres.sk[res] == sk) { | 697 | if (pnres.sk[res] == sk) { |
698 | rcu_assign_pointer(pnres.sk[res], NULL); | 698 | RCU_INIT_POINTER(pnres.sk[res], NULL); |
699 | ret = 0; | 699 | ret = 0; |
700 | } | 700 | } |
701 | mutex_unlock(&resource_mutex); | 701 | mutex_unlock(&resource_mutex); |
@@ -714,7 +714,7 @@ void pn_sock_unbind_all_res(struct sock *sk) | |||
714 | mutex_lock(&resource_mutex); | 714 | mutex_lock(&resource_mutex); |
715 | for (res = 0; res < 256; res++) { | 715 | for (res = 0; res < 256; res++) { |
716 | if (pnres.sk[res] == sk) { | 716 | if (pnres.sk[res] == sk) { |
717 | rcu_assign_pointer(pnres.sk[res], NULL); | 717 | RCU_INIT_POINTER(pnres.sk[res], NULL); |
718 | match++; | 718 | match++; |
719 | } | 719 | } |
720 | } | 720 | } |