From 498d8e236304a62a2774d7264bdff2c6e8102b5b Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 7 Jul 2011 22:06:26 +0000 Subject: drivers/net: 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. This patch covers all remaining network drivers still containing such a check. Cc: Joe Perches Signed-off-by: Tobias Klauser Signed-off-by: David S. Miller --- drivers/net/ewrk3.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'drivers/net/ewrk3.c') diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c index d1e229f9e54..05a5f71451a 100644 --- a/drivers/net/ewrk3.c +++ b/drivers/net/ewrk3.c @@ -1169,7 +1169,7 @@ static void SetMulticastFilter(struct net_device *dev) struct netdev_hw_addr *ha; u_long iobase = dev->base_addr; int i; - char *addrs, bit, byte; + char bit, byte; short __iomem *p = lp->mctbl; u16 hashcode; u32 crc; @@ -1211,25 +1211,22 @@ static void SetMulticastFilter(struct net_device *dev) /* Update table */ netdev_for_each_mc_addr(ha, dev) { - addrs = ha->addr; - if ((*addrs & 0x01) == 1) { /* multicast address? */ - crc = ether_crc_le(ETH_ALEN, addrs); - hashcode = crc & ((1 << 9) - 1); /* hashcode is 9 LSb of CRC */ + crc = ether_crc_le(ETH_ALEN, ha->addr); + hashcode = crc & ((1 << 9) - 1); /* hashcode is 9 LSb of CRC */ - byte = hashcode >> 3; /* bit[3-8] -> byte in filter */ - bit = 1 << (hashcode & 0x07); /* bit[0-2] -> bit in byte */ + byte = hashcode >> 3; /* bit[3-8] -> byte in filter */ + bit = 1 << (hashcode & 0x07); /* bit[0-2] -> bit in byte */ - if (lp->shmem_length == IO_ONLY) { - u_char tmp; + if (lp->shmem_length == IO_ONLY) { + u_char tmp; - outw(PAGE0_HTE + byte, EWRK3_PIR1); - tmp = inb(EWRK3_DATA); - tmp |= bit; - outw(PAGE0_HTE + byte, EWRK3_PIR1); - outb(tmp, EWRK3_DATA); - } else { - writeb(readb(lp->mctbl + byte) | bit, lp->mctbl + byte); - } + outw(PAGE0_HTE + byte, EWRK3_PIR1); + tmp = inb(EWRK3_DATA); + tmp |= bit; + outw(PAGE0_HTE + byte, EWRK3_PIR1); + outb(tmp, EWRK3_DATA); + } else { + writeb(readb(lp->mctbl + byte) | bit, lp->mctbl + byte); } } } -- cgit v1.2.3-18-g5258