aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sunhme.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/sunhme.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/sunhme.c')
-rw-r--r--drivers/net/sunhme.c16
1 files changed, 2 insertions, 14 deletions
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 }