diff options
author | Joe Perches <joe@perches.com> | 2012-05-08 14:56:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-09 20:49:18 -0400 |
commit | c47fc9814ca15cc075f1f09e8c069b041f2ea397 (patch) | |
tree | bf03a7e2ebe89b5ec993762d4386b4e1a752726a /net/bluetooth/bnep | |
parent | 150238ebb4a1ad2c3d09aea754720ad2e898c59f (diff) |
bluetooth: 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 'net/bluetooth/bnep')
-rw-r--r-- | net/bluetooth/bnep/core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index a779ec703323..88884d1d95fd 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c | |||
@@ -69,7 +69,7 @@ static struct bnep_session *__bnep_get_session(u8 *dst) | |||
69 | BT_DBG(""); | 69 | BT_DBG(""); |
70 | 70 | ||
71 | list_for_each_entry(s, &bnep_session_list, list) | 71 | list_for_each_entry(s, &bnep_session_list, list) |
72 | if (!compare_ether_addr(dst, s->eh.h_source)) | 72 | if (ether_addr_equal(dst, s->eh.h_source)) |
73 | return s; | 73 | return s; |
74 | 74 | ||
75 | return NULL; | 75 | return NULL; |
@@ -422,10 +422,10 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb) | |||
422 | iv[il++] = (struct kvec) { &type, 1 }; | 422 | iv[il++] = (struct kvec) { &type, 1 }; |
423 | len++; | 423 | len++; |
424 | 424 | ||
425 | if (compress_src && !compare_ether_addr(eh->h_dest, s->eh.h_source)) | 425 | if (compress_src && ether_addr_equal(eh->h_dest, s->eh.h_source)) |
426 | type |= 0x01; | 426 | type |= 0x01; |
427 | 427 | ||
428 | if (compress_dst && !compare_ether_addr(eh->h_source, s->eh.h_dest)) | 428 | if (compress_dst && ether_addr_equal(eh->h_source, s->eh.h_dest)) |
429 | type |= 0x02; | 429 | type |= 0x02; |
430 | 430 | ||
431 | if (type) | 431 | if (type) |