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/cfg.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/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 3d1b091d9b2e..86f8f49dae2f 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -62,7 +62,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, | |||
62 | 62 | ||
63 | if (type == NL80211_IFTYPE_AP_VLAN && | 63 | if (type == NL80211_IFTYPE_AP_VLAN && |
64 | params && params->use_4addr == 0) | 64 | params && params->use_4addr == 0) |
65 | rcu_assign_pointer(sdata->u.vlan.sta, NULL); | 65 | RCU_INIT_POINTER(sdata->u.vlan.sta, NULL); |
66 | else if (type == NL80211_IFTYPE_STATION && | 66 | else if (type == NL80211_IFTYPE_STATION && |
67 | params && params->use_4addr >= 0) | 67 | params && params->use_4addr >= 0) |
68 | sdata->u.mgd.use_4addr = params->use_4addr; | 68 | sdata->u.mgd.use_4addr = params->use_4addr; |
@@ -542,7 +542,7 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata, | |||
542 | 542 | ||
543 | sdata->vif.bss_conf.dtim_period = new->dtim_period; | 543 | sdata->vif.bss_conf.dtim_period = new->dtim_period; |
544 | 544 | ||
545 | rcu_assign_pointer(sdata->u.ap.beacon, new); | 545 | RCU_INIT_POINTER(sdata->u.ap.beacon, new); |
546 | 546 | ||
547 | synchronize_rcu(); | 547 | synchronize_rcu(); |
548 | 548 | ||
@@ -594,7 +594,7 @@ static int ieee80211_del_beacon(struct wiphy *wiphy, struct net_device *dev) | |||
594 | if (!old) | 594 | if (!old) |
595 | return -ENOENT; | 595 | return -ENOENT; |
596 | 596 | ||
597 | rcu_assign_pointer(sdata->u.ap.beacon, NULL); | 597 | RCU_INIT_POINTER(sdata->u.ap.beacon, NULL); |
598 | synchronize_rcu(); | 598 | synchronize_rcu(); |
599 | kfree(old); | 599 | kfree(old); |
600 | 600 | ||
@@ -857,7 +857,7 @@ static int ieee80211_change_station(struct wiphy *wiphy, | |||
857 | return -EBUSY; | 857 | return -EBUSY; |
858 | } | 858 | } |
859 | 859 | ||
860 | rcu_assign_pointer(vlansdata->u.vlan.sta, sta); | 860 | RCU_INIT_POINTER(vlansdata->u.vlan.sta, sta); |
861 | } | 861 | } |
862 | 862 | ||
863 | sta->sdata = vlansdata; | 863 | sta->sdata = vlansdata; |