diff options
author | Joe Perches <joe@perches.com> | 2013-09-01 12:15:47 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-17 07:47:44 -0700 |
commit | 8329419a29d15abebc3aefb57f4c6bfdbded7d89 (patch) | |
tree | d8409cc4c33cbeb543250e8e3373de6894a89618 /drivers/staging/slicoss | |
parent | eed88971337309d50396578ae268cfa79feb3ca0 (diff) | |
download | linux-8329419a29d15abebc3aefb57f4c6bfdbded7d89.tar.gz linux-8329419a29d15abebc3aefb57f4c6bfdbded7d89.tar.bz2 linux-8329419a29d15abebc3aefb57f4c6bfdbded7d89.zip |
Staging: Convert uses of compare_ether_addr to ether_addr_equal
Preliminary to removing compare_ether_addr altogether:
Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.
Additionally:
Used is_zero_ether_addr, removed now unused variable
Converted uses of &foo[0] to foo
Done via cocci script: (and a little typing)
$ 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/slicoss')
-rw-r--r-- | drivers/staging/slicoss/slicoss.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c index 869dcd3b385a..b6eb5df7a426 100644 --- a/drivers/staging/slicoss/slicoss.c +++ b/drivers/staging/slicoss/slicoss.c @@ -791,8 +791,8 @@ static bool slic_mac_filter(struct adapter *adapter, struct mcast_address *mcaddr = adapter->mcastaddrs; while (mcaddr) { - if (!compare_ether_addr(mcaddr->address, - ether_frame->ether_dhost)) { + if (ether_addr_equal(mcaddr->address, + ether_frame->ether_dhost)) { adapter->rcv_multicasts++; netdev->stats.multicast++; return true; @@ -2333,7 +2333,7 @@ static int slic_mcast_add_list(struct adapter *adapter, char *address) /* Check to see if it already exists */ mlist = adapter->mcastaddrs; while (mlist) { - if (!compare_ether_addr(mlist->address, address)) + if (ether_addr_equal(mlist->address, address)) return 0; mlist = mlist->next; } |