diff options
author | Joe Perches <joe@perches.com> | 2012-05-08 18:56:55 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-09 20:49:19 -0400 |
commit | ac422d3cc25351819ec80b7e2852fd2c600c317c (patch) | |
tree | a6ca456ad41256bf2cee71a189c1c05027f16532 /net/wireless/util.c | |
parent | 8561cf99785faf73cccb9f417170d8b5844bf496 (diff) | |
download | linux-rpi3-ac422d3cc25351819ec80b7e2852fd2c600c317c.tar.gz linux-rpi3-ac422d3cc25351819ec80b7e2852fd2c600c317c.tar.bz2 linux-rpi3-ac422d3cc25351819ec80b7e2852fd2c600c317c.zip |
wireless: 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.
I removed a conversion from scan.c/cmp_bss_core
that appears to be a sorting function.
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/wireless/util.c')
-rw-r--r-- | net/wireless/util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c index 6cba00173a2f..3ba366f51b07 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -609,10 +609,9 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, payload = frame->data; ethertype = (payload[6] << 8) | payload[7]; - if (likely((compare_ether_addr(payload, rfc1042_header) == 0 && + if (likely((ether_addr_equal(payload, rfc1042_header) && ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) || - compare_ether_addr(payload, - bridge_tunnel_header) == 0)) { + ether_addr_equal(payload, bridge_tunnel_header))) { /* remove RFC1042 or Bridge-Tunnel * encapsulation and replace EtherType */ skb_pull(frame, 6); |