Commit 30ae835f authored by kirjanov@gmail.com's avatar kirjanov@gmail.com Committed by Greg Kroah-Hartman

staging: slicoss Use compare_ether_addr.

Use compare_ether_addr.
Signed-off-by: default avatarDenis Kirjanov <kirjanov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5d372900
...@@ -527,15 +527,6 @@ struct adapter { ...@@ -527,15 +527,6 @@ struct adapter {
(largestat) += ((newstat) - (oldstat)); \ (largestat) += ((newstat) - (oldstat)); \
} }
#define ETHER_EQ_ADDR(_AddrA, _AddrB, _Result) \
{ \
_Result = true; \
if (*(u32 *)(_AddrA) != *(u32 *)(_AddrB)) \
_Result = false; \
if (*(u16 *)(&((_AddrA)[4])) != *(u16 *)(&((_AddrB)[4]))) \
_Result = false; \
}
#if defined(CONFIG_X86_64) || defined(CONFIG_IA64) #if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
#define SLIC_GET_ADDR_LOW(_addr) (u32)((u64)(_addr) & \ #define SLIC_GET_ADDR_LOW(_addr) (u32)((u64)(_addr) & \
0x00000000FFFFFFFF) 0x00000000FFFFFFFF)
......
...@@ -1249,13 +1249,11 @@ static struct net_device_stats *slic_get_stats(struct net_device *dev) ...@@ -1249,13 +1249,11 @@ static struct net_device_stats *slic_get_stats(struct net_device *dev)
static int slic_mcast_add_list(struct adapter *adapter, char *address) static int slic_mcast_add_list(struct adapter *adapter, char *address)
{ {
struct mcast_address *mcaddr, *mlist; struct mcast_address *mcaddr, *mlist;
bool equaladdr;
/* Check to see if it already exists */ /* Check to see if it already exists */
mlist = adapter->mcastaddrs; mlist = adapter->mcastaddrs;
while (mlist) { while (mlist) {
ETHER_EQ_ADDR(mlist->address, address, equaladdr); if (!compare_ether_addr(mlist->address, address))
if (equaladdr)
return STATUS_SUCCESS; return STATUS_SUCCESS;
mlist = mlist->next; mlist = mlist->next;
} }
...@@ -2469,7 +2467,6 @@ static bool slic_mac_filter(struct adapter *adapter, ...@@ -2469,7 +2467,6 @@ static bool slic_mac_filter(struct adapter *adapter,
u32 opts = adapter->macopts; u32 opts = adapter->macopts;
u32 *dhost4 = (u32 *)&ether_frame->ether_dhost[0]; u32 *dhost4 = (u32 *)&ether_frame->ether_dhost[0];
u16 *dhost2 = (u16 *)&ether_frame->ether_dhost[4]; u16 *dhost2 = (u16 *)&ether_frame->ether_dhost[4];
bool equaladdr;
if (opts & MAC_PROMISC) if (opts & MAC_PROMISC)
return true; return true;
...@@ -2493,10 +2490,8 @@ static bool slic_mac_filter(struct adapter *adapter, ...@@ -2493,10 +2490,8 @@ static bool slic_mac_filter(struct adapter *adapter,
struct mcast_address *mcaddr = adapter->mcastaddrs; struct mcast_address *mcaddr = adapter->mcastaddrs;
while (mcaddr) { while (mcaddr) {
ETHER_EQ_ADDR(mcaddr->address, if (!compare_ether_addr(mcaddr->address,
ether_frame->ether_dhost, ether_frame->ether_dhost)) {
equaladdr);
if (equaladdr) {
adapter->rcv_multicasts++; adapter->rcv_multicasts++;
adapter->stats.multicast++; adapter->stats.multicast++;
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment