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/mac80211/sta_info.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/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 3db78b696c5c..8b6ebee073e2 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -72,7 +72,7 @@ static int sta_info_hash_del(struct ieee80211_local *local, | |||
72 | if (!s) | 72 | if (!s) |
73 | return -ENOENT; | 73 | return -ENOENT; |
74 | if (s == sta) { | 74 | if (s == sta) { |
75 | rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], | 75 | RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)], |
76 | s->hnext); | 76 | s->hnext); |
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |
@@ -82,7 +82,7 @@ static int sta_info_hash_del(struct ieee80211_local *local, | |||
82 | s = rcu_dereference_protected(s->hnext, | 82 | s = rcu_dereference_protected(s->hnext, |
83 | lockdep_is_held(&local->sta_lock)); | 83 | lockdep_is_held(&local->sta_lock)); |
84 | if (rcu_access_pointer(s->hnext)) { | 84 | if (rcu_access_pointer(s->hnext)) { |
85 | rcu_assign_pointer(s->hnext, sta->hnext); | 85 | RCU_INIT_POINTER(s->hnext, sta->hnext); |
86 | return 0; | 86 | return 0; |
87 | } | 87 | } |
88 | 88 | ||
@@ -184,7 +184,7 @@ static void sta_info_hash_add(struct ieee80211_local *local, | |||
184 | struct sta_info *sta) | 184 | struct sta_info *sta) |
185 | { | 185 | { |
186 | sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)]; | 186 | sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)]; |
187 | rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta); | 187 | RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)], sta); |
188 | } | 188 | } |
189 | 189 | ||
190 | static void sta_unblock(struct work_struct *wk) | 190 | static void sta_unblock(struct work_struct *wk) |
@@ -672,7 +672,7 @@ static int __must_check __sta_info_destroy(struct sta_info *sta) | |||
672 | local->sta_generation++; | 672 | local->sta_generation++; |
673 | 673 | ||
674 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | 674 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
675 | rcu_assign_pointer(sdata->u.vlan.sta, NULL); | 675 | RCU_INIT_POINTER(sdata->u.vlan.sta, NULL); |
676 | 676 | ||
677 | if (sta->uploaded) { | 677 | if (sta->uploaded) { |
678 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | 678 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |