diff options
author | Joe Perches <joe@perches.com> | 2012-05-09 13:04:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-10 23:33:01 -0400 |
commit | a6700db17980972199e61c06be535a79e1b0b4e6 (patch) | |
tree | bd0f635fd96def6c13b3ad4bebbabf5d5e1fd011 /drivers/net/macvlan.c | |
parent | baf523c9ba4a69e97b0b5a6fb0e0a9e43550a65b (diff) |
net, drivers/net: Convert compare_ether_addr_64bits to ether_addr_equal_64bits
Use the new bool function ether_addr_equal_64bits to add
some clarity and reduce the likelihood for misuse of
compare_ether_addr_64bits for sorting.
Done via cocci script:
$ cat compare_ether_addr_64bits.cocci
@@
expression a,b;
@@
- !compare_ether_addr_64bits(a, b)
+ ether_addr_equal_64bits(a, b)
@@
expression a,b;
@@
- compare_ether_addr_64bits(a, b)
+ !ether_addr_equal_64bits(a, b)
@@
expression a,b;
@@
- !ether_addr_equal_64bits(a, b) == 0
+ ether_addr_equal_64bits(a, b)
@@
expression a,b;
@@
- !ether_addr_equal_64bits(a, b) != 0
+ !ether_addr_equal_64bits(a, b)
@@
expression a,b;
@@
- ether_addr_equal_64bits(a, b) == 0
+ !ether_addr_equal_64bits(a, b)
@@
expression a,b;
@@
- ether_addr_equal_64bits(a, b) != 0
+ ether_addr_equal_64bits(a, b)
@@
expression a,b;
@@
- !!ether_addr_equal_64bits(a, b)
+ ether_addr_equal_64bits(a, b)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r-- | drivers/net/macvlan.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 9653ed6998fe..ebacec1944ed 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -57,7 +57,7 @@ static struct macvlan_dev *macvlan_hash_lookup(const struct macvlan_port *port, | |||
57 | struct hlist_node *n; | 57 | struct hlist_node *n; |
58 | 58 | ||
59 | hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[addr[5]], hlist) { | 59 | hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[addr[5]], hlist) { |
60 | if (!compare_ether_addr_64bits(vlan->dev->dev_addr, addr)) | 60 | if (ether_addr_equal_64bits(vlan->dev->dev_addr, addr)) |
61 | return vlan; | 61 | return vlan; |
62 | } | 62 | } |
63 | return NULL; | 63 | return NULL; |
@@ -96,7 +96,7 @@ static int macvlan_addr_busy(const struct macvlan_port *port, | |||
96 | * currently in use by the underlying device or | 96 | * currently in use by the underlying device or |
97 | * another macvlan. | 97 | * another macvlan. |
98 | */ | 98 | */ |
99 | if (!compare_ether_addr_64bits(port->dev->dev_addr, addr)) | 99 | if (ether_addr_equal_64bits(port->dev->dev_addr, addr)) |
100 | return 1; | 100 | return 1; |
101 | 101 | ||
102 | if (macvlan_hash_lookup(port, addr)) | 102 | if (macvlan_hash_lookup(port, addr)) |
@@ -118,8 +118,7 @@ static int macvlan_broadcast_one(struct sk_buff *skb, | |||
118 | return vlan->forward(dev, skb); | 118 | return vlan->forward(dev, skb); |
119 | 119 | ||
120 | skb->dev = dev; | 120 | skb->dev = dev; |
121 | if (!compare_ether_addr_64bits(eth->h_dest, | 121 | if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) |
122 | dev->broadcast)) | ||
123 | skb->pkt_type = PACKET_BROADCAST; | 122 | skb->pkt_type = PACKET_BROADCAST; |
124 | else | 123 | else |
125 | skb->pkt_type = PACKET_MULTICAST; | 124 | skb->pkt_type = PACKET_MULTICAST; |