aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/depca.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2011-06-29 02:15:15 +0000
committerDavid S. Miller <davem@davemloft.net>2011-06-30 22:13:38 -0700
commit3170ff54c26004ea627022af695d0c8709d29b04 (patch)
treee4d3cc24adacebdf3e4c31de89d6805b2ee513d1 /drivers/net/depca.c
parentnet: am79c961a: Omit check for multicast bit in netdev_for_each_mc_addr (diff)
downloadlinux-dev-3170ff54c26004ea627022af695d0c8709d29b04.tar.xz
linux-dev-3170ff54c26004ea627022af695d0c8709d29b04.zip
net: depca: Omit check for multicast bit in netdev_for_each_mc_addr
There is no need to check for the address being a multicast address in the netdev_for_each_mc_addr loop, so remove it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/depca.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index d54a0e93ba93..a7ccaa67c7d4 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -1270,7 +1270,6 @@ static void SetMulticastFilter(struct net_device *dev)
{
struct depca_private *lp = netdev_priv(dev);
struct netdev_hw_addr *ha;
- char *addrs;
int i, j, bit, byte;
u16 hashcode;
u32 crc;
@@ -1285,19 +1284,15 @@ static void SetMulticastFilter(struct net_device *dev)
}
/* Add multicast addresses */
netdev_for_each_mc_addr(ha, dev) {
- addrs = ha->addr;
- if ((*addrs & 0x01) == 1) { /* multicast address? */
- crc = ether_crc(ETH_ALEN, addrs);
- hashcode = (crc & 1); /* hashcode is 6 LSb of CRC ... */
- for (j = 0; j < 5; j++) { /* ... in reverse order. */
- hashcode = (hashcode << 1) | ((crc >>= 1) & 1);
- }
-
-
- byte = hashcode >> 3; /* bit[3-5] -> byte in filter */
- bit = 1 << (hashcode & 0x07); /* bit[0-2] -> bit in byte */
- lp->init_block.mcast_table[byte] |= bit;
+ crc = ether_crc(ETH_ALEN, ha->addr);
+ hashcode = (crc & 1); /* hashcode is 6 LSb of CRC ... */
+ for (j = 0; j < 5; j++) { /* ... in reverse order. */
+ hashcode = (hashcode << 1) | ((crc >>= 1) & 1);
}
+
+ byte = hashcode >> 3; /* bit[3-5] -> byte in filter */
+ bit = 1 << (hashcode & 0x07); /* bit[0-2] -> bit in byte */
+ lp->init_block.mcast_table[byte] |= bit;
}
}
}