drivers/net: 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>
This commit is contained in:

committed by
David S. Miller

parent
39f1d94d30
commit
2e42e4747e
@@ -1965,7 +1965,7 @@ qlcnic_send_filter(struct qlcnic_adapter *adapter,
|
||||
__le16 vlan_id = 0;
|
||||
u8 hindex;
|
||||
|
||||
if (!compare_ether_addr(phdr->h_source, adapter->mac_addr))
|
||||
if (ether_addr_equal(phdr->h_source, adapter->mac_addr))
|
||||
return;
|
||||
|
||||
if (adapter->fhash.fnum >= adapter->fhash.fmax)
|
||||
@@ -2235,8 +2235,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
|
||||
|
||||
if (adapter->flags & QLCNIC_MACSPOOF) {
|
||||
phdr = (struct ethhdr *)skb->data;
|
||||
if (compare_ether_addr(phdr->h_source,
|
||||
adapter->mac_addr))
|
||||
if (!ether_addr_equal(phdr->h_source, adapter->mac_addr))
|
||||
goto drop_packet;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user