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 /net/ethernet | |
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 'net/ethernet')
-rw-r--r-- | net/ethernet/eth.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 5889a6c38a10..36e58800a9e3 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c | |||
@@ -164,7 +164,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
164 | eth = eth_hdr(skb); | 164 | eth = eth_hdr(skb); |
165 | 165 | ||
166 | if (unlikely(is_multicast_ether_addr(eth->h_dest))) { | 166 | if (unlikely(is_multicast_ether_addr(eth->h_dest))) { |
167 | if (!compare_ether_addr_64bits(eth->h_dest, dev->broadcast)) | 167 | if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) |
168 | skb->pkt_type = PACKET_BROADCAST; | 168 | skb->pkt_type = PACKET_BROADCAST; |
169 | else | 169 | else |
170 | skb->pkt_type = PACKET_MULTICAST; | 170 | skb->pkt_type = PACKET_MULTICAST; |
@@ -179,7 +179,8 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
179 | */ | 179 | */ |
180 | 180 | ||
181 | else if (1 /*dev->flags&IFF_PROMISC */ ) { | 181 | else if (1 /*dev->flags&IFF_PROMISC */ ) { |
182 | if (unlikely(compare_ether_addr_64bits(eth->h_dest, dev->dev_addr))) | 182 | if (unlikely(!ether_addr_equal_64bits(eth->h_dest, |
183 | dev->dev_addr))) | ||
183 | skb->pkt_type = PACKET_OTHERHOST; | 184 | skb->pkt_type = PACKET_OTHERHOST; |
184 | } | 185 | } |
185 | 186 | ||