mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
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:
parent
39f1d94d30
commit
2e42e4747e
31 changed files with 85 additions and 86 deletions
|
@ -944,8 +944,7 @@ static void enic_update_multicast_addr_list(struct enic *enic)
|
|||
|
||||
for (i = 0; i < enic->mc_count; i++) {
|
||||
for (j = 0; j < mc_count; j++)
|
||||
if (compare_ether_addr(enic->mc_addr[i],
|
||||
mc_addr[j]) == 0)
|
||||
if (ether_addr_equal(enic->mc_addr[i], mc_addr[j]))
|
||||
break;
|
||||
if (j == mc_count)
|
||||
enic_dev_del_addr(enic, enic->mc_addr[i]);
|
||||
|
@ -953,8 +952,7 @@ static void enic_update_multicast_addr_list(struct enic *enic)
|
|||
|
||||
for (i = 0; i < mc_count; i++) {
|
||||
for (j = 0; j < enic->mc_count; j++)
|
||||
if (compare_ether_addr(mc_addr[i],
|
||||
enic->mc_addr[j]) == 0)
|
||||
if (ether_addr_equal(mc_addr[i], enic->mc_addr[j]))
|
||||
break;
|
||||
if (j == enic->mc_count)
|
||||
enic_dev_add_addr(enic, mc_addr[i]);
|
||||
|
@ -999,8 +997,7 @@ static void enic_update_unicast_addr_list(struct enic *enic)
|
|||
|
||||
for (i = 0; i < enic->uc_count; i++) {
|
||||
for (j = 0; j < uc_count; j++)
|
||||
if (compare_ether_addr(enic->uc_addr[i],
|
||||
uc_addr[j]) == 0)
|
||||
if (ether_addr_equal(enic->uc_addr[i], uc_addr[j]))
|
||||
break;
|
||||
if (j == uc_count)
|
||||
enic_dev_del_addr(enic, enic->uc_addr[i]);
|
||||
|
@ -1008,8 +1005,7 @@ static void enic_update_unicast_addr_list(struct enic *enic)
|
|||
|
||||
for (i = 0; i < uc_count; i++) {
|
||||
for (j = 0; j < enic->uc_count; j++)
|
||||
if (compare_ether_addr(uc_addr[i],
|
||||
enic->uc_addr[j]) == 0)
|
||||
if (ether_addr_equal(uc_addr[i], enic->uc_addr[j]))
|
||||
break;
|
||||
if (j == enic->uc_count)
|
||||
enic_dev_add_addr(enic, uc_addr[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue