aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.cz>2011-07-08 08:39:41 -0400
committerJiri Kosina <jkosina@suse.cz>2011-07-08 16:21:58 -0400
commitd8bf4ca9ca9576548628344c9725edd3786e90b1 (patch)
treedf338f50a5af6bc3651bd863b79fa91e6b1e9e20 /net
parenteb032b9837a958e21ca000358a5bde5e17192ddb (diff)
rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
Since ca5ecddf (rcu: define __rcu address space modifier for sparse) rcu_dereference_check use rcu_read_lock_held as a part of condition automatically so callers do not have to do that as well. Signed-off-by: Michal Hocko <mhocko@suse.cz> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/sta_info.c4
-rw-r--r--net/netlabel/netlabel_domainhash.c3
-rw-r--r--net/netlabel/netlabel_unlabeled.c3
3 files changed, 2 insertions, 8 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index b83870bf60fa..3db78b696c5c 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -97,7 +97,6 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
97 struct sta_info *sta; 97 struct sta_info *sta;
98 98
99 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], 99 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)],
100 rcu_read_lock_held() ||
101 lockdep_is_held(&local->sta_lock) || 100 lockdep_is_held(&local->sta_lock) ||
102 lockdep_is_held(&local->sta_mtx)); 101 lockdep_is_held(&local->sta_mtx));
103 while (sta) { 102 while (sta) {
@@ -105,7 +104,6 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
105 memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) 104 memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
106 break; 105 break;
107 sta = rcu_dereference_check(sta->hnext, 106 sta = rcu_dereference_check(sta->hnext,
108 rcu_read_lock_held() ||
109 lockdep_is_held(&local->sta_lock) || 107 lockdep_is_held(&local->sta_lock) ||
110 lockdep_is_held(&local->sta_mtx)); 108 lockdep_is_held(&local->sta_mtx));
111 } 109 }
@@ -123,7 +121,6 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
123 struct sta_info *sta; 121 struct sta_info *sta;
124 122
125 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], 123 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)],
126 rcu_read_lock_held() ||
127 lockdep_is_held(&local->sta_lock) || 124 lockdep_is_held(&local->sta_lock) ||
128 lockdep_is_held(&local->sta_mtx)); 125 lockdep_is_held(&local->sta_mtx));
129 while (sta) { 126 while (sta) {
@@ -132,7 +129,6 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
132 memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) 129 memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
133 break; 130 break;
134 sta = rcu_dereference_check(sta->hnext, 131 sta = rcu_dereference_check(sta->hnext,
135 rcu_read_lock_held() ||
136 lockdep_is_held(&local->sta_lock) || 132 lockdep_is_held(&local->sta_lock) ||
137 lockdep_is_held(&local->sta_mtx)); 133 lockdep_is_held(&local->sta_mtx));
138 } 134 }
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c
index de0d8e4cbfb6..2aa975e5452d 100644
--- a/net/netlabel/netlabel_domainhash.c
+++ b/net/netlabel/netlabel_domainhash.c
@@ -55,8 +55,7 @@ struct netlbl_domhsh_tbl {
55 * should be okay */ 55 * should be okay */
56static DEFINE_SPINLOCK(netlbl_domhsh_lock); 56static DEFINE_SPINLOCK(netlbl_domhsh_lock);
57#define netlbl_domhsh_rcu_deref(p) \ 57#define netlbl_domhsh_rcu_deref(p) \
58 rcu_dereference_check(p, rcu_read_lock_held() || \ 58 rcu_dereference_check(p, lockdep_is_held(&netlbl_domhsh_lock))
59 lockdep_is_held(&netlbl_domhsh_lock))
60static struct netlbl_domhsh_tbl *netlbl_domhsh = NULL; 59static struct netlbl_domhsh_tbl *netlbl_domhsh = NULL;
61static struct netlbl_dom_map *netlbl_domhsh_def = NULL; 60static struct netlbl_dom_map *netlbl_domhsh_def = NULL;
62 61
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 9c38658fba8b..3de3768360fd 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -116,8 +116,7 @@ struct netlbl_unlhsh_walk_arg {
116 * hash table should be okay */ 116 * hash table should be okay */
117static DEFINE_SPINLOCK(netlbl_unlhsh_lock); 117static DEFINE_SPINLOCK(netlbl_unlhsh_lock);
118#define netlbl_unlhsh_rcu_deref(p) \ 118#define netlbl_unlhsh_rcu_deref(p) \
119 rcu_dereference_check(p, rcu_read_lock_held() || \ 119 rcu_dereference_check(p, lockdep_is_held(&netlbl_unlhsh_lock))
120 lockdep_is_held(&netlbl_unlhsh_lock))
121static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL; 120static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL;
122static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL; 121static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL;
123 122