diff mbox

[3/4] ath10k: prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()

Message ID 20160324142352.15808.33417.stgit@potku.adurom.net (mailing list archive)
State Changes Requested
Headers show

Commit Message

Kalle Valo March 24, 2016, 2:23 p.m. UTC
Fixes checkpatch warnings:

drivers/net/wireless/ath/ath10k/mac.c:452: Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()
drivers/net/wireless/ath/ath10k/mac.c:455: Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()
drivers/net/wireless/ath/ath10k/txrx.c:133: Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/mac.c  |    4 ++--
 drivers/net/wireless/ath/ath10k/txrx.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Kalle Valo April 6, 2016, 2:47 p.m. UTC | #1
Kalle Valo <kvalo@qca.qualcomm.com> writes:

> Fixes checkpatch warnings:
>
> drivers/net/wireless/ath/ath10k/mac.c:452: Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()
> drivers/net/wireless/ath/ath10k/mac.c:455: Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()
> drivers/net/wireless/ath/ath10k/txrx.c:133: Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()
>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath10k/mac.c  |    4 ++--
>  drivers/net/wireless/ath/ath10k/txrx.c |    2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 74a0e25183d0..c89f711a796b 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -449,10 +449,10 @@ static int ath10k_mac_vif_update_wep_key(struct ath10k_vif *arvif,
>  	lockdep_assert_held(&ar->conf_mutex);
>  
>  	list_for_each_entry(peer, &ar->peers, list) {
> -		if (!memcmp(peer->addr, arvif->vif->addr, ETH_ALEN))
> +		if (!ether_addr_equal(peer->addr, arvif->vif->addr))
>  			continue;
>  
> -		if (!memcmp(peer->addr, arvif->bssid, ETH_ALEN))
> +		if (!ether_addr_equal(peer->addr, arvif->bssid))
>  			continue;
>  
>  		if (peer->keys[key->keyidx] == key)
> diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c
> index 31335c510f1e..17a493b3333e 100644
> --- a/drivers/net/wireless/ath/ath10k/txrx.c
> +++ b/drivers/net/wireless/ath/ath10k/txrx.c
> @@ -130,7 +130,7 @@ struct ath10k_peer *ath10k_peer_find(struct ath10k *ar, int vdev_id,
>  	list_for_each_entry(peer, &ar->peers, list) {
>  		if (peer->vdev_id != vdev_id)
>  			continue;
> -		if (memcmp(peer->addr, addr, ETH_ALEN))
> +		if (ether_addr_equal(peer->addr, addr))
>  			continue;

A brown paperbag bug, I got the tests reversed. Will send v2.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 74a0e25183d0..c89f711a796b 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -449,10 +449,10 @@  static int ath10k_mac_vif_update_wep_key(struct ath10k_vif *arvif,
 	lockdep_assert_held(&ar->conf_mutex);
 
 	list_for_each_entry(peer, &ar->peers, list) {
-		if (!memcmp(peer->addr, arvif->vif->addr, ETH_ALEN))
+		if (!ether_addr_equal(peer->addr, arvif->vif->addr))
 			continue;
 
-		if (!memcmp(peer->addr, arvif->bssid, ETH_ALEN))
+		if (!ether_addr_equal(peer->addr, arvif->bssid))
 			continue;
 
 		if (peer->keys[key->keyidx] == key)
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c
index 31335c510f1e..17a493b3333e 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.c
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
@@ -130,7 +130,7 @@  struct ath10k_peer *ath10k_peer_find(struct ath10k *ar, int vdev_id,
 	list_for_each_entry(peer, &ar->peers, list) {
 		if (peer->vdev_id != vdev_id)
 			continue;
-		if (memcmp(peer->addr, addr, ETH_ALEN))
+		if (ether_addr_equal(peer->addr, addr))
 			continue;
 
 		return peer;