diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2013-12-30 13:15:03 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-01-03 15:36:59 -0500 |
commit | ccbac290555bf7ddfae2e39cb84fd17988785799 (patch) | |
tree | fe26343ae374cc55f99c57dacb8016501ccb9483 /drivers/net/wireless/iwlegacy | |
parent | 90908e1cd14716f1b989b97003007bfcc7be3d13 (diff) |
iwlegacy: use ether_addr_equal_64bits
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.
The structures involved are:
ieee80211_hdr defined in include/linux/ieee80211.h,
il_priv defined in drivers/net/wireless/iwlegacy/common.h and
il_rxon_cmd defined in drivers/net/wireless/iwlegacy/commands.h
This was done using Coccinelle (http://coccinelle.lip6.fr/).
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r-- | drivers/net/wireless/iwlegacy/3945.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c index f09e257759d5..27e543c6c5d6 100644 --- a/drivers/net/wireless/iwlegacy/3945.c +++ b/drivers/net/wireless/iwlegacy/3945.c | |||
@@ -466,10 +466,10 @@ il3945_is_network_packet(struct il_priv *il, struct ieee80211_hdr *header) | |||
466 | switch (il->iw_mode) { | 466 | switch (il->iw_mode) { |
467 | case NL80211_IFTYPE_ADHOC: /* Header: Dest. | Source | BSSID */ | 467 | case NL80211_IFTYPE_ADHOC: /* Header: Dest. | Source | BSSID */ |
468 | /* packets to our IBSS update information */ | 468 | /* packets to our IBSS update information */ |
469 | return ether_addr_equal(header->addr3, il->bssid); | 469 | return ether_addr_equal_64bits(header->addr3, il->bssid); |
470 | case NL80211_IFTYPE_STATION: /* Header: Dest. | AP{BSSID} | Source */ | 470 | case NL80211_IFTYPE_STATION: /* Header: Dest. | AP{BSSID} | Source */ |
471 | /* packets to our IBSS update information */ | 471 | /* packets to our IBSS update information */ |
472 | return ether_addr_equal(header->addr2, il->bssid); | 472 | return ether_addr_equal_64bits(header->addr2, il->bssid); |
473 | default: | 473 | default: |
474 | return 1; | 474 | return 1; |
475 | } | 475 | } |
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index a27b14cfeaec..da4d24d35900 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -3746,10 +3746,10 @@ il_full_rxon_required(struct il_priv *il) | |||
3746 | 3746 | ||
3747 | /* These items are only settable from the full RXON command */ | 3747 | /* These items are only settable from the full RXON command */ |
3748 | CHK(!il_is_associated(il)); | 3748 | CHK(!il_is_associated(il)); |
3749 | CHK(!ether_addr_equal(staging->bssid_addr, active->bssid_addr)); | 3749 | CHK(!ether_addr_equal_64bits(staging->bssid_addr, active->bssid_addr)); |
3750 | CHK(!ether_addr_equal(staging->node_addr, active->node_addr)); | 3750 | CHK(!ether_addr_equal_64bits(staging->node_addr, active->node_addr)); |
3751 | CHK(!ether_addr_equal(staging->wlap_bssid_addr, | 3751 | CHK(!ether_addr_equal_64bits(staging->wlap_bssid_addr, |
3752 | active->wlap_bssid_addr)); | 3752 | active->wlap_bssid_addr)); |
3753 | CHK_NEQ(staging->dev_type, active->dev_type); | 3753 | CHK_NEQ(staging->dev_type, active->dev_type); |
3754 | CHK_NEQ(staging->channel, active->channel); | 3754 | CHK_NEQ(staging->channel, active->channel); |
3755 | CHK_NEQ(staging->air_propagation, active->air_propagation); | 3755 | CHK_NEQ(staging->air_propagation, active->air_propagation); |