diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2011-07-08 00:06:26 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-08 18:03:20 +0200 |
commit | 498d8e236304a62a2774d7264bdff2c6e8102b5b (patch) | |
tree | c1c5fa5ddf09a76bf0787e09fdc71fb8d5561b1c /drivers/net/ewrk3.c | |
parent | dcbnl: unlock on an error path in dcbnl_cee_fill() (diff) | |
download | linux-498d8e236304a62a2774d7264bdff2c6e8102b5b.tar.xz linux-498d8e236304a62a2774d7264bdff2c6e8102b5b.zip |
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 <joe@perches.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ewrk3.c')
-rw-r--r-- | drivers/net/ewrk3.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c index d1e229f9e540..05a5f71451a7 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); } } } |