diff options
author | Joe Perches <joe@perches.com> | 2012-05-09 13:17:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-10 23:33:01 -0400 |
commit | 2e42e4747ea72943c21551d8a206b51a9893b1e0 (patch) | |
tree | a92473c485911b51e1d960c9c8fa34dfc9be0a46 /drivers/net/ethernet/cisco | |
parent | 39f1d94d300a58eb3e9b851d077cada4e2fa9d46 (diff) |
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>
Diffstat (limited to 'drivers/net/ethernet/cisco')
-rw-r--r-- | drivers/net/ethernet/cisco/enic/enic_main.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index d7ac6c17547c..8132c785cea8 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c | |||
@@ -944,8 +944,7 @@ static void enic_update_multicast_addr_list(struct enic *enic) | |||
944 | 944 | ||
945 | for (i = 0; i < enic->mc_count; i++) { | 945 | for (i = 0; i < enic->mc_count; i++) { |
946 | for (j = 0; j < mc_count; j++) | 946 | for (j = 0; j < mc_count; j++) |
947 | if (compare_ether_addr(enic->mc_addr[i], | 947 | if (ether_addr_equal(enic->mc_addr[i], mc_addr[j])) |
948 | mc_addr[j]) == 0) | ||
949 | break; | 948 | break; |
950 | if (j == mc_count) | 949 | if (j == mc_count) |
951 | enic_dev_del_addr(enic, enic->mc_addr[i]); | 950 | enic_dev_del_addr(enic, enic->mc_addr[i]); |
@@ -953,8 +952,7 @@ static void enic_update_multicast_addr_list(struct enic *enic) | |||
953 | 952 | ||
954 | for (i = 0; i < mc_count; i++) { | 953 | for (i = 0; i < mc_count; i++) { |
955 | for (j = 0; j < enic->mc_count; j++) | 954 | for (j = 0; j < enic->mc_count; j++) |
956 | if (compare_ether_addr(mc_addr[i], | 955 | if (ether_addr_equal(mc_addr[i], enic->mc_addr[j])) |
957 | enic->mc_addr[j]) == 0) | ||
958 | break; | 956 | break; |
959 | if (j == enic->mc_count) | 957 | if (j == enic->mc_count) |
960 | enic_dev_add_addr(enic, mc_addr[i]); | 958 | enic_dev_add_addr(enic, mc_addr[i]); |
@@ -999,8 +997,7 @@ static void enic_update_unicast_addr_list(struct enic *enic) | |||
999 | 997 | ||
1000 | for (i = 0; i < enic->uc_count; i++) { | 998 | for (i = 0; i < enic->uc_count; i++) { |
1001 | for (j = 0; j < uc_count; j++) | 999 | for (j = 0; j < uc_count; j++) |
1002 | if (compare_ether_addr(enic->uc_addr[i], | 1000 | if (ether_addr_equal(enic->uc_addr[i], uc_addr[j])) |
1003 | uc_addr[j]) == 0) | ||
1004 | break; | 1001 | break; |
1005 | if (j == uc_count) | 1002 | if (j == uc_count) |
1006 | enic_dev_del_addr(enic, enic->uc_addr[i]); | 1003 | enic_dev_del_addr(enic, enic->uc_addr[i]); |
@@ -1008,8 +1005,7 @@ static void enic_update_unicast_addr_list(struct enic *enic) | |||
1008 | 1005 | ||
1009 | for (i = 0; i < uc_count; i++) { | 1006 | for (i = 0; i < uc_count; i++) { |
1010 | for (j = 0; j < enic->uc_count; j++) | 1007 | for (j = 0; j < enic->uc_count; j++) |
1011 | if (compare_ether_addr(uc_addr[i], | 1008 | if (ether_addr_equal(uc_addr[i], enic->uc_addr[j])) |
1012 | enic->uc_addr[j]) == 0) | ||
1013 | break; | 1009 | break; |
1014 | if (j == enic->uc_count) | 1010 | if (j == enic->uc_count) |
1015 | enic_dev_add_addr(enic, uc_addr[i]); | 1011 | enic_dev_add_addr(enic, uc_addr[i]); |