diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-18 07:02:26 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-19 01:47:50 +0300 |
commit | a92635dc77b14f0f28d45c0fbf91b5064d9d7617 (patch) | |
tree | efc3a7a9a4b559614e56339aaa26171495bfb0c9 /drivers/net/usb/smsc95xx.c | |
parent | 4302b67e041ea81c8fc233bee1296516e1294a27 (diff) | |
download | linux-a92635dc77b14f0f28d45c0fbf91b5064d9d7617.tar.xz |
net/usb: convert to use netdev_for_each_mc_addr
also removed needless checks in smsc95xx
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/smsc95xx.c')
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 1ada51eb71f7..df9179a1c93b 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -384,30 +384,20 @@ static void smsc95xx_set_multicast(struct net_device *netdev) pdata->mac_cr |= MAC_CR_MCPAS_; pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); } else if (!netdev_mc_empty(dev->net)) { - struct dev_mc_list *mc_list = dev->net->mc_list; - int count = 0; + struct dev_mc_list *mc_list; pdata->mac_cr |= MAC_CR_HPFILT_; pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_); - while (mc_list) { - count++; - if (mc_list->dmi_addrlen == ETH_ALEN) { - u32 bitnum = smsc95xx_hash(mc_list->dmi_addr); - u32 mask = 0x01 << (bitnum & 0x1F); - if (bitnum & 0x20) - hash_hi |= mask; - else - hash_lo |= mask; - } else { - netdev_warn(dev->net, "dmi_addrlen != 6\n"); - } - mc_list = mc_list->next; + netdev_for_each_mc_addr(mc_list, netdev) { + u32 bitnum = smsc95xx_hash(mc_list->dmi_addr); + u32 mask = 0x01 << (bitnum & 0x1F); + if (bitnum & 0x20) + hash_hi |= mask; + else + hash_lo |= mask; } - if (count != ((u32) netdev_mc_count(dev->net))) - netdev_warn(dev->net, "mc_count != dev->mc_count\n"); - netif_dbg(dev, drv, dev->net, "HASHH=0x%08X, HASHL=0x%08X\n", hash_hi, hash_lo); } else { |