aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.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/ibss.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/ibss.c')
-rw-r--r--net/mac80211/ibss.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 61cd391c32a3..d307d3b3e32a 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -66,7 +66,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
66 skb_reset_tail_pointer(skb); 66 skb_reset_tail_pointer(skb);
67 skb_reserve(skb, sdata->local->hw.extra_tx_headroom); 67 skb_reserve(skb, sdata->local->hw.extra_tx_headroom);
68 68
69 if (compare_ether_addr(ifibss->bssid, bssid)) 69 if (!ether_addr_equal(ifibss->bssid, bssid))
70 sta_info_flush(sdata->local, sdata); 70 sta_info_flush(sdata->local, sdata);
71 71
72 /* if merging, indicate to driver that we leave the old IBSS */ 72 /* if merging, indicate to driver that we leave the old IBSS */
@@ -315,7 +315,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
315 return NULL; 315 return NULL;
316 } 316 }
317 317
318 if (compare_ether_addr(bssid, sdata->u.ibss.bssid)) { 318 if (!ether_addr_equal(bssid, sdata->u.ibss.bssid)) {
319 rcu_read_lock(); 319 rcu_read_lock();
320 return NULL; 320 return NULL;
321 } 321 }
@@ -401,7 +401,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
401 return; 401 return;
402 402
403 if (sdata->vif.type == NL80211_IFTYPE_ADHOC && 403 if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
404 compare_ether_addr(mgmt->bssid, sdata->u.ibss.bssid) == 0) { 404 ether_addr_equal(mgmt->bssid, sdata->u.ibss.bssid)) {
405 405
406 rcu_read_lock(); 406 rcu_read_lock();
407 sta = sta_info_get(sdata, mgmt->sa); 407 sta = sta_info_get(sdata, mgmt->sa);
@@ -506,7 +506,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
506 goto put_bss; 506 goto put_bss;
507 507
508 /* same BSSID */ 508 /* same BSSID */
509 if (compare_ether_addr(cbss->bssid, sdata->u.ibss.bssid) == 0) 509 if (ether_addr_equal(cbss->bssid, sdata->u.ibss.bssid))
510 goto put_bss; 510 goto put_bss;
511 511
512 if (rx_status->flag & RX_FLAG_MACTIME_MPDU) { 512 if (rx_status->flag & RX_FLAG_MACTIME_MPDU) {
@@ -591,7 +591,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
591 if (ifibss->state == IEEE80211_IBSS_MLME_SEARCH) 591 if (ifibss->state == IEEE80211_IBSS_MLME_SEARCH)
592 return; 592 return;
593 593
594 if (compare_ether_addr(bssid, sdata->u.ibss.bssid)) 594 if (!ether_addr_equal(bssid, sdata->u.ibss.bssid))
595 return; 595 return;
596 596
597 sta = sta_info_alloc(sdata, addr, GFP_ATOMIC); 597 sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
@@ -829,7 +829,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
829 if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da)) 829 if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da))
830 return; 830 return;
831 831
832 if (compare_ether_addr(mgmt->bssid, ifibss->bssid) != 0 && 832 if (!ether_addr_equal(mgmt->bssid, ifibss->bssid) &&
833 !is_broadcast_ether_addr(mgmt->bssid)) 833 !is_broadcast_ether_addr(mgmt->bssid))
834 return; 834 return;
835 835