aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ewrk3.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2011-07-07 18:06:26 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-08 12:03:20 -0400
commit498d8e236304a62a2774d7264bdff2c6e8102b5b (patch)
treec1c5fa5ddf09a76bf0787e09fdc71fb8d5561b1c /drivers/net/ewrk3.c
parent40f5d72a4fc098c47068e3888cfb055922f6519f (diff)
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.c31
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)
1169 struct netdev_hw_addr *ha; 1169 struct netdev_hw_addr *ha;
1170 u_long iobase = dev->base_addr; 1170 u_long iobase = dev->base_addr;
1171 int i; 1171 int i;
1172 char *addrs, bit, byte; 1172 char bit, byte;
1173 short __iomem *p = lp->mctbl; 1173 short __iomem *p = lp->mctbl;
1174 u16 hashcode; 1174 u16 hashcode;
1175 u32 crc; 1175 u32 crc;
@@ -1211,25 +1211,22 @@ static void SetMulticastFilter(struct net_device *dev)
1211 1211
1212 /* Update table */ 1212 /* Update table */
1213 netdev_for_each_mc_addr(ha, dev) { 1213 netdev_for_each_mc_addr(ha, dev) {
1214 addrs = ha->addr; 1214 crc = ether_crc_le(ETH_ALEN, ha->addr);
1215 if ((*addrs & 0x01) == 1) { /* multicast address? */ 1215 hashcode = crc & ((1 << 9) - 1); /* hashcode is 9 LSb of CRC */
1216 crc = ether_crc_le(ETH_ALEN, addrs);
1217 hashcode = crc & ((1 << 9) - 1); /* hashcode is 9 LSb of CRC */
1218 1216
1219 byte = hashcode >> 3; /* bit[3-8] -> byte in filter */ 1217 byte = hashcode >> 3; /* bit[3-8] -> byte in filter */
1220 bit = 1 << (hashcode & 0x07); /* bit[0-2] -> bit in byte */ 1218 bit = 1 << (hashcode & 0x07); /* bit[0-2] -> bit in byte */
1221 1219
1222 if (lp->shmem_length == IO_ONLY) { 1220 if (lp->shmem_length == IO_ONLY) {
1223 u_char tmp; 1221 u_char tmp;
1224 1222
1225 outw(PAGE0_HTE + byte, EWRK3_PIR1); 1223 outw(PAGE0_HTE + byte, EWRK3_PIR1);
1226 tmp = inb(EWRK3_DATA); 1224 tmp = inb(EWRK3_DATA);
1227 tmp |= bit; 1225 tmp |= bit;
1228 outw(PAGE0_HTE + byte, EWRK3_PIR1); 1226 outw(PAGE0_HTE + byte, EWRK3_PIR1);
1229 outb(tmp, EWRK3_DATA); 1227 outb(tmp, EWRK3_DATA);
1230 } else { 1228 } else {
1231 writeb(readb(lp->mctbl + byte) | bit, lp->mctbl + byte); 1229 writeb(readb(lp->mctbl + byte) | bit, lp->mctbl + byte);
1232 }
1233 } 1230 }
1234 } 1231 }
1235 } 1232 }