diff options
author | Joe Perches <joe@perches.com> | 2012-05-08 14:56:55 -0400 |
---|---|---|
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) |
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, | |||
609 | payload = frame->data; | 609 | payload = frame->data; |
610 | ethertype = (payload[6] << 8) | payload[7]; | 610 | ethertype = (payload[6] << 8) | payload[7]; |
611 | 611 | ||
612 | if (likely((compare_ether_addr(payload, rfc1042_header) == 0 && | 612 | if (likely((ether_addr_equal(payload, rfc1042_header) && |
613 | ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) || | 613 | ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) || |
614 | compare_ether_addr(payload, | 614 | ether_addr_equal(payload, bridge_tunnel_header))) { |
615 | bridge_tunnel_header) == 0)) { | ||
616 | /* remove RFC1042 or Bridge-Tunnel | 615 | /* remove RFC1042 or Bridge-Tunnel |
617 | * encapsulation and replace EtherType */ | 616 | * encapsulation and replace EtherType */ |
618 | skb_pull(frame, 6); | 617 | skb_pull(frame, 6); |