aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
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
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')
-rw-r--r--drivers/net/7990.c9
-rw-r--r--drivers/net/a2065.c9
-rw-r--r--drivers/net/bmac.c8
-rw-r--r--drivers/net/declance.c9
-rw-r--r--drivers/net/ewrk3.c31
-rw-r--r--drivers/net/fec.c4
-rw-r--r--drivers/net/hp100.c18
-rw-r--r--drivers/net/ioc3-eth.c7
-rw-r--r--drivers/net/korina.c7
-rw-r--r--drivers/net/ks8851_mll.c2
-rw-r--r--drivers/net/ksz884x.c2
-rw-r--r--drivers/net/pcnet32.c9
-rw-r--r--drivers/net/smc911x.c5
-rw-r--r--drivers/net/smc9194.c5
-rw-r--r--drivers/net/smc91x.c5
-rw-r--r--drivers/net/sunbmac.c8
-rw-r--r--drivers/net/sungem.c7
-rw-r--r--drivers/net/sunhme.c16
-rw-r--r--drivers/net/sunlance.c8
-rw-r--r--drivers/net/sunqe.c7
20 files changed, 35 insertions, 141 deletions
diff --git a/drivers/net/7990.c b/drivers/net/7990.c
index 903bcb3ef5bd..60b35fb5f524 100644
--- a/drivers/net/7990.c
+++ b/drivers/net/7990.c
@@ -594,7 +594,6 @@ static void lance_load_multicast (struct net_device *dev)
594 volatile struct lance_init_block *ib = lp->init_block; 594 volatile struct lance_init_block *ib = lp->init_block;
595 volatile u16 *mcast_table = (u16 *)&ib->filter; 595 volatile u16 *mcast_table = (u16 *)&ib->filter;
596 struct netdev_hw_addr *ha; 596 struct netdev_hw_addr *ha;
597 char *addrs;
598 u32 crc; 597 u32 crc;
599 598
600 /* set all multicast bits */ 599 /* set all multicast bits */
@@ -609,13 +608,7 @@ static void lance_load_multicast (struct net_device *dev)
609 608
610 /* Add addresses */ 609 /* Add addresses */
611 netdev_for_each_mc_addr(ha, dev) { 610 netdev_for_each_mc_addr(ha, dev) {
612 addrs = ha->addr; 611 crc = ether_crc_le(6, ha->addr);
613
614 /* multicast address? */
615 if (!(*addrs & 1))
616 continue;
617
618 crc = ether_crc_le(6, addrs);
619 crc = crc >> 26; 612 crc = crc >> 26;
620 mcast_table [crc >> 4] |= 1 << (crc & 0xf); 613 mcast_table [crc >> 4] |= 1 << (crc & 0xf);
621 } 614 }
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index 7d9a1a6ea8b2..e1e1b07d9b8d 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -587,7 +587,6 @@ static void lance_load_multicast(struct net_device *dev)
587 volatile struct lance_init_block *ib = lp->init_block; 587 volatile struct lance_init_block *ib = lp->init_block;
588 volatile u16 *mcast_table = (u16 *)&ib->filter; 588 volatile u16 *mcast_table = (u16 *)&ib->filter;
589 struct netdev_hw_addr *ha; 589 struct netdev_hw_addr *ha;
590 char *addrs;
591 u32 crc; 590 u32 crc;
592 591
593 /* set all multicast bits */ 592 /* set all multicast bits */
@@ -602,13 +601,7 @@ static void lance_load_multicast(struct net_device *dev)
602 601
603 /* Add addresses */ 602 /* Add addresses */
604 netdev_for_each_mc_addr(ha, dev) { 603 netdev_for_each_mc_addr(ha, dev) {
605 addrs = ha->addr; 604 crc = ether_crc_le(6, ha->addr);
606
607 /* multicast address? */
608 if (!(*addrs & 1))
609 continue;
610
611 crc = ether_crc_le(6, addrs);
612 crc = crc >> 26; 605 crc = crc >> 26;
613 mcast_table[crc >> 4] |= 1 << (crc & 0xf); 606 mcast_table[crc >> 4] |= 1 << (crc & 0xf);
614 } 607 }
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index d2e58e2bea78..45e45e8d3d66 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -1015,7 +1015,6 @@ static void bmac_set_multicast(struct net_device *dev)
1015static void bmac_set_multicast(struct net_device *dev) 1015static void bmac_set_multicast(struct net_device *dev)
1016{ 1016{
1017 struct netdev_hw_addr *ha; 1017 struct netdev_hw_addr *ha;
1018 char *addrs;
1019 int i; 1018 int i;
1020 unsigned short rx_cfg; 1019 unsigned short rx_cfg;
1021 u32 crc; 1020 u32 crc;
@@ -1039,12 +1038,7 @@ static void bmac_set_multicast(struct net_device *dev)
1039 for(i = 0; i < 4; i++) hash_table[i] = 0; 1038 for(i = 0; i < 4; i++) hash_table[i] = 0;
1040 1039
1041 netdev_for_each_mc_addr(ha, dev) { 1040 netdev_for_each_mc_addr(ha, dev) {
1042 addrs = ha->addr; 1041 crc = ether_crc_le(6, ha->addr);
1043
1044 if(!(*addrs & 1))
1045 continue;
1046
1047 crc = ether_crc_le(6, addrs);
1048 crc >>= 26; 1042 crc >>= 26;
1049 hash_table[crc >> 4] |= 1 << (crc & 0xf); 1043 hash_table[crc >> 4] |= 1 << (crc & 0xf);
1050 } 1044 }
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index cabd3a542ef0..d5598f6584a3 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -946,7 +946,6 @@ static void lance_load_multicast(struct net_device *dev)
946 struct lance_private *lp = netdev_priv(dev); 946 struct lance_private *lp = netdev_priv(dev);
947 volatile u16 *ib = (volatile u16 *)dev->mem_start; 947 volatile u16 *ib = (volatile u16 *)dev->mem_start;
948 struct netdev_hw_addr *ha; 948 struct netdev_hw_addr *ha;
949 char *addrs;
950 u32 crc; 949 u32 crc;
951 950
952 /* set all multicast bits */ 951 /* set all multicast bits */
@@ -965,13 +964,7 @@ static void lance_load_multicast(struct net_device *dev)
965 964
966 /* Add addresses */ 965 /* Add addresses */
967 netdev_for_each_mc_addr(ha, dev) { 966 netdev_for_each_mc_addr(ha, dev) {
968 addrs = ha->addr; 967 crc = ether_crc_le(ETH_ALEN, ha->addr);
969
970 /* multicast address? */
971 if (!(*addrs & 1))
972 continue;
973
974 crc = ether_crc_le(ETH_ALEN, addrs);
975 crc = crc >> 26; 968 crc = crc >> 26;
976 *lib_ptr(ib, filter[crc >> 4], lp->type) |= 1 << (crc & 0xf); 969 *lib_ptr(ib, filter[crc >> 4], lp->type) |= 1 << (crc & 0xf);
977 } 970 }
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 }
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 7ae3f2814200..5b631fe74738 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1227,10 +1227,6 @@ static void set_multicast_list(struct net_device *ndev)
1227 writel(0, fep->hwp + FEC_GRP_HASH_TABLE_LOW); 1227 writel(0, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
1228 1228
1229 netdev_for_each_mc_addr(ha, ndev) { 1229 netdev_for_each_mc_addr(ha, ndev) {
1230 /* Only support group multicast for now */
1231 if (!(ha->addr[0] & 1))
1232 continue;
1233
1234 /* calculate crc32 value of mac address */ 1230 /* calculate crc32 value of mac address */
1235 crc = 0xffffffff; 1231 crc = 0xffffffff;
1236 1232
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index c3ecb118c1df..b6519c1ba7e1 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -2103,20 +2103,18 @@ static void hp100_set_multicast_list(struct net_device *dev)
2103#endif 2103#endif
2104 netdev_for_each_mc_addr(ha, dev) { 2104 netdev_for_each_mc_addr(ha, dev) {
2105 addrs = ha->addr; 2105 addrs = ha->addr;
2106 if ((*addrs & 0x01) == 0x01) { /* multicast address? */
2107#ifdef HP100_DEBUG 2106#ifdef HP100_DEBUG
2108 printk("hp100: %s: multicast = %pM, ", 2107 printk("hp100: %s: multicast = %pM, ",
2109 dev->name, addrs); 2108 dev->name, addrs);
2110#endif 2109#endif
2111 for (i = idx = 0; i < 6; i++) { 2110 for (i = idx = 0; i < 6; i++) {
2112 idx ^= *addrs++ & 0x3f; 2111 idx ^= *addrs++ & 0x3f;
2113 printk(":%02x:", idx); 2112 printk(":%02x:", idx);
2114 } 2113 }
2115#ifdef HP100_DEBUG 2114#ifdef HP100_DEBUG
2116 printk("idx = %i\n", idx); 2115 printk("idx = %i\n", idx);
2117#endif 2116#endif
2118 lp->hash_bytes[idx >> 3] |= (1 << (idx & 7)); 2117 lp->hash_bytes[idx >> 3] |= (1 << (idx & 7));
2119 }
2120 } 2118 }
2121 } 2119 }
2122#else 2120#else
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 318a25a92310..a234e4504522 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -1664,12 +1664,7 @@ static void ioc3_set_multicast_list(struct net_device *dev)
1664 ip->ehar_l = 0xffffffff; 1664 ip->ehar_l = 0xffffffff;
1665 } else { 1665 } else {
1666 netdev_for_each_mc_addr(ha, dev) { 1666 netdev_for_each_mc_addr(ha, dev) {
1667 char *addr = ha->addr; 1667 ehar |= (1UL << ioc3_hash(ha->addr));
1668
1669 if (!(*addr & 1))
1670 continue;
1671
1672 ehar |= (1UL << ioc3_hash(addr));
1673 } 1668 }
1674 ip->ehar_h = ehar >> 32; 1669 ip->ehar_h = ehar >> 32;
1675 ip->ehar_l = ehar & 0xffffffff; 1670 ip->ehar_l = ehar & 0xffffffff;
diff --git a/drivers/net/korina.c b/drivers/net/korina.c
index c7a9bef4dfb0..763844c587fd 100644
--- a/drivers/net/korina.c
+++ b/drivers/net/korina.c
@@ -504,12 +504,7 @@ static void korina_multicast_list(struct net_device *dev)
504 hash_table[i] = 0; 504 hash_table[i] = 0;
505 505
506 netdev_for_each_mc_addr(ha, dev) { 506 netdev_for_each_mc_addr(ha, dev) {
507 char *addrs = ha->addr; 507 crc = ether_crc_le(6, ha->addr);
508
509 if (!(*addrs & 1))
510 continue;
511
512 crc = ether_crc_le(6, addrs);
513 crc >>= 26; 508 crc >>= 26;
514 hash_table[crc >> 4] |= 1 << (15 - (crc & 0xf)); 509 hash_table[crc >> 4] |= 1 << (15 - (crc & 0xf));
515 } 510 }
diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
index a82378231fc5..d19c849059d8 100644
--- a/drivers/net/ks8851_mll.c
+++ b/drivers/net/ks8851_mll.c
@@ -1190,8 +1190,6 @@ static void ks_set_rx_mode(struct net_device *netdev)
1190 int i = 0; 1190 int i = 0;
1191 1191
1192 netdev_for_each_mc_addr(ha, netdev) { 1192 netdev_for_each_mc_addr(ha, netdev) {
1193 if (!(*ha->addr & 1))
1194 continue;
1195 if (i >= MAX_MCAST_LST) 1193 if (i >= MAX_MCAST_LST)
1196 break; 1194 break;
1197 memcpy(ks->mcast_lst[i++], ha->addr, ETH_ALEN); 1195 memcpy(ks->mcast_lst[i++], ha->addr, ETH_ALEN);
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c
index 2ac6c6c984b3..27418d31a09f 100644
--- a/drivers/net/ksz884x.c
+++ b/drivers/net/ksz884x.c
@@ -5785,8 +5785,6 @@ static void netdev_set_rx_mode(struct net_device *dev)
5785 } 5785 }
5786 5786
5787 netdev_for_each_mc_addr(ha, dev) { 5787 netdev_for_each_mc_addr(ha, dev) {
5788 if (!(*ha->addr & 1))
5789 continue;
5790 if (i >= MAX_MULTICAST_LIST) 5788 if (i >= MAX_MULTICAST_LIST)
5791 break; 5789 break;
5792 memcpy(hw->multi_list[i++], ha->addr, MAC_ADDR_LEN); 5790 memcpy(hw->multi_list[i++], ha->addr, MAC_ADDR_LEN);
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index b48aba9e4227..8b3090dc4bcd 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -2570,7 +2570,6 @@ static void pcnet32_load_multicast(struct net_device *dev)
2570 volatile __le16 *mcast_table = (__le16 *)ib->filter; 2570 volatile __le16 *mcast_table = (__le16 *)ib->filter;
2571 struct netdev_hw_addr *ha; 2571 struct netdev_hw_addr *ha;
2572 unsigned long ioaddr = dev->base_addr; 2572 unsigned long ioaddr = dev->base_addr;
2573 char *addrs;
2574 int i; 2573 int i;
2575 u32 crc; 2574 u32 crc;
2576 2575
@@ -2590,13 +2589,7 @@ static void pcnet32_load_multicast(struct net_device *dev)
2590 2589
2591 /* Add addresses */ 2590 /* Add addresses */
2592 netdev_for_each_mc_addr(ha, dev) { 2591 netdev_for_each_mc_addr(ha, dev) {
2593 addrs = ha->addr; 2592 crc = ether_crc_le(6, ha->addr);
2594
2595 /* multicast address? */
2596 if (!(*addrs & 1))
2597 continue;
2598
2599 crc = ether_crc_le(6, addrs);
2600 crc = crc >> 26; 2593 crc = crc >> 26;
2601 mcast_table[crc >> 4] |= cpu_to_le16(1 << (crc & 0xf)); 2594 mcast_table[crc >> 4] |= cpu_to_le16(1 << (crc & 0xf));
2602 } 2595 }
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 053863aefb12..a91fe1723020 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -1351,11 +1351,6 @@ static void smc911x_set_multicast_list(struct net_device *dev)
1351 netdev_for_each_mc_addr(ha, dev) { 1351 netdev_for_each_mc_addr(ha, dev) {
1352 u32 position; 1352 u32 position;
1353 1353
1354 /* make sure this is a multicast address -
1355 shouldn't this be a given if we have it here ? */
1356 if (!(*ha->addr & 1))
1357 continue;
1358
1359 /* upper 6 bits are used as hash index */ 1354 /* upper 6 bits are used as hash index */
1360 position = ether_crc(ETH_ALEN, ha->addr)>>26; 1355 position = ether_crc(ETH_ALEN, ha->addr)>>26;
1361 1356
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c
index 7486d0908064..5b65ac4b3cef 100644
--- a/drivers/net/smc9194.c
+++ b/drivers/net/smc9194.c
@@ -447,11 +447,6 @@ static void smc_setmulticast(int ioaddr, struct net_device *dev)
447 netdev_for_each_mc_addr(ha, dev) { 447 netdev_for_each_mc_addr(ha, dev) {
448 int position; 448 int position;
449 449
450 /* make sure this is a multicast address - shouldn't this
451 be a given if we have it here ? */
452 if (!(*ha->addr & 1))
453 continue;
454
455 /* only use the low order bits */ 450 /* only use the low order bits */
456 position = ether_crc_le(6, ha->addr) & 0x3f; 451 position = ether_crc_le(6, ha->addr) & 0x3f;
457 452
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index f6285748bd3c..2b1d254d59af 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -1425,11 +1425,6 @@ static void smc_set_multicast_list(struct net_device *dev)
1425 netdev_for_each_mc_addr(ha, dev) { 1425 netdev_for_each_mc_addr(ha, dev) {
1426 int position; 1426 int position;
1427 1427
1428 /* make sure this is a multicast address -
1429 shouldn't this be a given if we have it here ? */
1430 if (!(*ha->addr & 1))
1431 continue;
1432
1433 /* only use the low order bits */ 1428 /* only use the low order bits */
1434 position = crc32_le(~0, ha->addr, 6) & 0x3f; 1429 position = crc32_le(~0, ha->addr, 6) & 0x3f;
1435 1430
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index aa4765803a4c..297a4242106b 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -998,7 +998,6 @@ static void bigmac_set_multicast(struct net_device *dev)
998 struct bigmac *bp = netdev_priv(dev); 998 struct bigmac *bp = netdev_priv(dev);
999 void __iomem *bregs = bp->bregs; 999 void __iomem *bregs = bp->bregs;
1000 struct netdev_hw_addr *ha; 1000 struct netdev_hw_addr *ha;
1001 char *addrs;
1002 int i; 1001 int i;
1003 u32 tmp, crc; 1002 u32 tmp, crc;
1004 1003
@@ -1027,12 +1026,7 @@ static void bigmac_set_multicast(struct net_device *dev)
1027 hash_table[i] = 0; 1026 hash_table[i] = 0;
1028 1027
1029 netdev_for_each_mc_addr(ha, dev) { 1028 netdev_for_each_mc_addr(ha, dev) {
1030 addrs = ha->addr; 1029 crc = ether_crc_le(6, ha->addr);
1031
1032 if (!(*addrs & 1))
1033 continue;
1034
1035 crc = ether_crc_le(6, addrs);
1036 crc >>= 26; 1030 crc >>= 26;
1037 hash_table[crc >> 4] |= 1 << (crc & 0xf); 1031 hash_table[crc >> 4] |= 1 << (crc & 0xf);
1038 } 1032 }
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 71d4a0329d02..ade35dde5b51 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1802,12 +1802,7 @@ static u32 gem_setup_multicast(struct gem *gp)
1802 1802
1803 memset(hash_table, 0, sizeof(hash_table)); 1803 memset(hash_table, 0, sizeof(hash_table));
1804 netdev_for_each_mc_addr(ha, gp->dev) { 1804 netdev_for_each_mc_addr(ha, gp->dev) {
1805 char *addrs = ha->addr; 1805 crc = ether_crc_le(6, ha->addr);
1806
1807 if (!(*addrs & 1))
1808 continue;
1809
1810 crc = ether_crc_le(6, addrs);
1811 crc >>= 24; 1806 crc >>= 24;
1812 hash_table[crc >> 4] |= 1 << (15 - (crc & 0xf)); 1807 hash_table[crc >> 4] |= 1 << (15 - (crc & 0xf));
1813 } 1808 }
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 30aad54b1b3a..856e05b9fba3 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -1524,17 +1524,11 @@ static int happy_meal_init(struct happy_meal *hp)
1524 } else if ((hp->dev->flags & IFF_PROMISC) == 0) { 1524 } else if ((hp->dev->flags & IFF_PROMISC) == 0) {
1525 u16 hash_table[4]; 1525 u16 hash_table[4];
1526 struct netdev_hw_addr *ha; 1526 struct netdev_hw_addr *ha;
1527 char *addrs;
1528 u32 crc; 1527 u32 crc;
1529 1528
1530 memset(hash_table, 0, sizeof(hash_table)); 1529 memset(hash_table, 0, sizeof(hash_table));
1531 netdev_for_each_mc_addr(ha, hp->dev) { 1530 netdev_for_each_mc_addr(ha, hp->dev) {
1532 addrs = ha->addr; 1531 crc = ether_crc_le(6, ha->addr);
1533
1534 if (!(*addrs & 1))
1535 continue;
1536
1537 crc = ether_crc_le(6, addrs);
1538 crc >>= 26; 1532 crc >>= 26;
1539 hash_table[crc >> 4] |= 1 << (crc & 0xf); 1533 hash_table[crc >> 4] |= 1 << (crc & 0xf);
1540 } 1534 }
@@ -2361,7 +2355,6 @@ static void happy_meal_set_multicast(struct net_device *dev)
2361 struct happy_meal *hp = netdev_priv(dev); 2355 struct happy_meal *hp = netdev_priv(dev);
2362 void __iomem *bregs = hp->bigmacregs; 2356 void __iomem *bregs = hp->bigmacregs;
2363 struct netdev_hw_addr *ha; 2357 struct netdev_hw_addr *ha;
2364 char *addrs;
2365 u32 crc; 2358 u32 crc;
2366 2359
2367 spin_lock_irq(&hp->happy_lock); 2360 spin_lock_irq(&hp->happy_lock);
@@ -2379,12 +2372,7 @@ static void happy_meal_set_multicast(struct net_device *dev)
2379 2372
2380 memset(hash_table, 0, sizeof(hash_table)); 2373 memset(hash_table, 0, sizeof(hash_table));
2381 netdev_for_each_mc_addr(ha, dev) { 2374 netdev_for_each_mc_addr(ha, dev) {
2382 addrs = ha->addr; 2375 crc = ether_crc_le(6, ha->addr);
2383
2384 if (!(*addrs & 1))
2385 continue;
2386
2387 crc = ether_crc_le(6, addrs);
2388 crc >>= 26; 2376 crc >>= 26;
2389 hash_table[crc >> 4] |= 1 << (crc & 0xf); 2377 hash_table[crc >> 4] |= 1 << (crc & 0xf);
2390 } 2378 }
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 32a5c7f63c43..06f2d4382dc4 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -1170,7 +1170,6 @@ static void lance_load_multicast(struct net_device *dev)
1170{ 1170{
1171 struct lance_private *lp = netdev_priv(dev); 1171 struct lance_private *lp = netdev_priv(dev);
1172 struct netdev_hw_addr *ha; 1172 struct netdev_hw_addr *ha;
1173 char *addrs;
1174 u32 crc; 1173 u32 crc;
1175 u32 val; 1174 u32 val;
1176 1175
@@ -1195,12 +1194,7 @@ static void lance_load_multicast(struct net_device *dev)
1195 1194
1196 /* Add addresses */ 1195 /* Add addresses */
1197 netdev_for_each_mc_addr(ha, dev) { 1196 netdev_for_each_mc_addr(ha, dev) {
1198 addrs = ha->addr; 1197 crc = ether_crc_le(6, ha->addr);
1199
1200 /* multicast address? */
1201 if (!(*addrs & 1))
1202 continue;
1203 crc = ether_crc_le(6, addrs);
1204 crc = crc >> 26; 1198 crc = crc >> 26;
1205 if (lp->pio_buffer) { 1199 if (lp->pio_buffer) {
1206 struct lance_init_block __iomem *ib = lp->init_block_iomem; 1200 struct lance_init_block __iomem *ib = lp->init_block_iomem;
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 18ecdc303751..209c7f8df003 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -628,7 +628,6 @@ static void qe_set_multicast(struct net_device *dev)
628 struct sunqe *qep = netdev_priv(dev); 628 struct sunqe *qep = netdev_priv(dev);
629 struct netdev_hw_addr *ha; 629 struct netdev_hw_addr *ha;
630 u8 new_mconfig = qep->mconfig; 630 u8 new_mconfig = qep->mconfig;
631 char *addrs;
632 int i; 631 int i;
633 u32 crc; 632 u32 crc;
634 633
@@ -651,11 +650,7 @@ static void qe_set_multicast(struct net_device *dev)
651 650
652 memset(hash_table, 0, sizeof(hash_table)); 651 memset(hash_table, 0, sizeof(hash_table));
653 netdev_for_each_mc_addr(ha, dev) { 652 netdev_for_each_mc_addr(ha, dev) {
654 addrs = ha->addr; 653 crc = ether_crc_le(6, ha->addr);
655
656 if (!(*addrs & 1))
657 continue;
658 crc = ether_crc_le(6, addrs);
659 crc >>= 26; 654 crc >>= 26;
660 hash_table[crc >> 4] |= 1 << (crc & 0xf); 655 hash_table[crc >> 4] |= 1 << (crc & 0xf);
661 } 656 }