diff options
author | Joe Perches <joe@perches.com> | 2012-05-09 13:17:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-10 23:33:01 -0400 |
commit | 2e42e4747ea72943c21551d8a206b51a9893b1e0 (patch) | |
tree | a92473c485911b51e1d960c9c8fa34dfc9be0a46 /drivers/net/wireless/ath | |
parent | 39f1d94d300a58eb3e9b851d077cada4e2fa9d46 (diff) |
drivers/net: 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 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/carl9170/rx.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 49e3b19cf781..0ba81a66061f 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -462,7 +462,7 @@ void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif) | |||
462 | } | 462 | } |
463 | 463 | ||
464 | if (iter_data->need_set_hw_addr && iter_data->hw_macaddr) | 464 | if (iter_data->need_set_hw_addr && iter_data->hw_macaddr) |
465 | if (compare_ether_addr(iter_data->hw_macaddr, mac) == 0) | 465 | if (ether_addr_equal(iter_data->hw_macaddr, mac)) |
466 | iter_data->need_set_hw_addr = false; | 466 | iter_data->need_set_hw_addr = false; |
467 | 467 | ||
468 | if (!iter_data->any_assoc) { | 468 | if (!iter_data->any_assoc) { |
@@ -1170,7 +1170,7 @@ ath5k_check_ibss_tsf(struct ath5k_hw *ah, struct sk_buff *skb, | |||
1170 | 1170 | ||
1171 | if (ieee80211_is_beacon(mgmt->frame_control) && | 1171 | if (ieee80211_is_beacon(mgmt->frame_control) && |
1172 | le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS && | 1172 | le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS && |
1173 | compare_ether_addr(mgmt->bssid, common->curbssid) == 0) { | 1173 | ether_addr_equal(mgmt->bssid, common->curbssid)) { |
1174 | /* | 1174 | /* |
1175 | * Received an IBSS beacon with the same BSSID. Hardware *must* | 1175 | * Received an IBSS beacon with the same BSSID. Hardware *must* |
1176 | * have updated the local TSF. We have to work around various | 1176 | * have updated the local TSF. We have to work around various |
@@ -1234,7 +1234,7 @@ ath5k_update_beacon_rssi(struct ath5k_hw *ah, struct sk_buff *skb, int rssi) | |||
1234 | 1234 | ||
1235 | /* only beacons from our BSSID */ | 1235 | /* only beacons from our BSSID */ |
1236 | if (!ieee80211_is_beacon(mgmt->frame_control) || | 1236 | if (!ieee80211_is_beacon(mgmt->frame_control) || |
1237 | compare_ether_addr(mgmt->bssid, common->curbssid) != 0) | 1237 | !ether_addr_equal(mgmt->bssid, common->curbssid)) |
1238 | return; | 1238 | return; |
1239 | 1239 | ||
1240 | ewma_add(&ah->ah_beacon_rssi_avg, rssi); | 1240 | ewma_add(&ah->ah_beacon_rssi_avg, rssi); |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 544e5490ca2e..e1fcc68124dc 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -1833,7 +1833,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1833 | if (ieee80211_is_beacon(hdr->frame_control)) { | 1833 | if (ieee80211_is_beacon(hdr->frame_control)) { |
1834 | RX_STAT_INC(rx_beacons); | 1834 | RX_STAT_INC(rx_beacons); |
1835 | if (!is_zero_ether_addr(common->curbssid) && | 1835 | if (!is_zero_ether_addr(common->curbssid) && |
1836 | !compare_ether_addr(hdr->addr3, common->curbssid)) | 1836 | ether_addr_equal(hdr->addr3, common->curbssid)) |
1837 | rs.is_mybeacon = true; | 1837 | rs.is_mybeacon = true; |
1838 | else | 1838 | else |
1839 | rs.is_mybeacon = false; | 1839 | rs.is_mybeacon = false; |
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c index dc99030ea8b6..84b22eec7abd 100644 --- a/drivers/net/wireless/ath/carl9170/rx.c +++ b/drivers/net/wireless/ath/carl9170/rx.c | |||
@@ -538,7 +538,7 @@ static void carl9170_ps_beacon(struct ar9170 *ar, void *data, unsigned int len) | |||
538 | return; | 538 | return; |
539 | 539 | ||
540 | /* and only beacons from the associated BSSID, please */ | 540 | /* and only beacons from the associated BSSID, please */ |
541 | if (compare_ether_addr(hdr->addr3, ar->common.curbssid) || | 541 | if (!ether_addr_equal(hdr->addr3, ar->common.curbssid) || |
542 | !ar->common.curaid) | 542 | !ar->common.curaid) |
543 | return; | 543 | return; |
544 | 544 | ||