aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-05-08 14:56:52 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-09 20:49:18 -0400
commitb203ca39126bad99583c908be587df067820a1ea (patch)
tree940e32bd15392b400cf50c2ac31c7895637c09fe /net/mac80211/sta_info.c
parentc47fc9814ca15cc075f1f09e8c069b041f2ea397 (diff)
mac80211: Convert compare_ether_addr to ether_addr_equal
Use the new bool function ether_addr_equal to add some clarity and reduce the likelihood for misuse of compare_ether_addr for sorting. Done via cocci script: $ cat compare_ether_addr.cocci @@ expression a,b; @@ - !compare_ether_addr(a, b) + ether_addr_equal(a, b) @@ expression a,b; @@ - compare_ether_addr(a, b) + !ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) == 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) != 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) == 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) != 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !!ether_addr_equal(a, b) + ether_addr_equal(a, b) Signed-off-by: Joe Perches <joe@perches.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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 97a9d6639fb9..f5b1638fbf80 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -102,7 +102,7 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
102 lockdep_is_held(&local->sta_mtx)); 102 lockdep_is_held(&local->sta_mtx));
103 while (sta) { 103 while (sta) {
104 if (sta->sdata == sdata && 104 if (sta->sdata == sdata &&
105 compare_ether_addr(sta->sta.addr, addr) == 0) 105 ether_addr_equal(sta->sta.addr, addr))
106 break; 106 break;
107 sta = rcu_dereference_check(sta->hnext, 107 sta = rcu_dereference_check(sta->hnext,
108 lockdep_is_held(&local->sta_mtx)); 108 lockdep_is_held(&local->sta_mtx));
@@ -125,7 +125,7 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
125 while (sta) { 125 while (sta) {
126 if ((sta->sdata == sdata || 126 if ((sta->sdata == sdata ||
127 (sta->sdata->bss && sta->sdata->bss == sdata->bss)) && 127 (sta->sdata->bss && sta->sdata->bss == sdata->bss)) &&
128 compare_ether_addr(sta->sta.addr, addr) == 0) 128 ether_addr_equal(sta->sta.addr, addr))
129 break; 129 break;
130 sta = rcu_dereference_check(sta->hnext, 130 sta = rcu_dereference_check(sta->hnext,
131 lockdep_is_held(&local->sta_mtx)); 131 lockdep_is_held(&local->sta_mtx));
@@ -302,7 +302,7 @@ static int sta_info_insert_check(struct sta_info *sta)
302 if (unlikely(!ieee80211_sdata_running(sdata))) 302 if (unlikely(!ieee80211_sdata_running(sdata)))
303 return -ENETDOWN; 303 return -ENETDOWN;
304 304
305 if (WARN_ON(compare_ether_addr(sta->sta.addr, sdata->vif.addr) == 0 || 305 if (WARN_ON(ether_addr_equal(sta->sta.addr, sdata->vif.addr) ||
306 is_multicast_ether_addr(sta->sta.addr))) 306 is_multicast_ether_addr(sta->sta.addr)))
307 return -EINVAL; 307 return -EINVAL;
308 308
@@ -912,7 +912,7 @@ struct ieee80211_sta *ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw,
912 */ 912 */
913 for_each_sta_info(hw_to_local(hw), addr, sta, nxt) { 913 for_each_sta_info(hw_to_local(hw), addr, sta, nxt) {
914 if (localaddr && 914 if (localaddr &&
915 compare_ether_addr(sta->sdata->vif.addr, localaddr) != 0) 915 !ether_addr_equal(sta->sdata->vif.addr, localaddr))
916 continue; 916 continue;
917 if (!sta->uploaded) 917 if (!sta->uploaded)
918 return NULL; 918 return NULL;