diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-23 10:19:49 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-26 11:07:30 +0100 |
commit | f9dcbcc9e338d08c0f7de7eba4eaafbbb7f81249 (patch) | |
tree | 8a1d9a37bc057440220a5ad23231e0fe974b93f6 /drivers/net/lib8390.c | |
parent | can: netlink support for bus-error reporting and counters (diff) | |
download | linux-f9dcbcc9e338d08c0f7de7eba4eaafbbb7f81249.tar.xz linux-f9dcbcc9e338d08c0f7de7eba4eaafbbb7f81249.zip |
net: convert multiple drivers to use netdev_for_each_mc_addr, part5 V2
removed some needless checks and also corrected bug in lp486e (dmi was passed
instead of dmi->dmi_addr)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/lib8390.c')
-rw-r--r-- | drivers/net/lib8390.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c index 57f25848fe80..56f66f485400 100644 --- a/drivers/net/lib8390.c +++ b/drivers/net/lib8390.c @@ -907,15 +907,8 @@ static inline void make_mc_bits(u8 *bits, struct net_device *dev) { struct dev_mc_list *dmi; - for (dmi=dev->mc_list; dmi; dmi=dmi->next) - { - u32 crc; - if (dmi->dmi_addrlen != ETH_ALEN) - { - printk(KERN_INFO "%s: invalid multicast address length given.\n", dev->name); - continue; - } - crc = ether_crc(ETH_ALEN, dmi->dmi_addr); + netdev_for_each_mc_addr(dmi, dev) { + u32 crc = ether_crc(ETH_ALEN, dmi->dmi_addr); /* * The 8390 uses the 6 most significant bits of the * CRC to index the multicast table. @@ -941,7 +934,7 @@ static void do_set_multicast_list(struct net_device *dev) if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI))) { memset(ei_local->mcfilter, 0, 8); - if (dev->mc_list) + if (!netdev_mc_empty(dev)) make_mc_bits(ei_local->mcfilter, dev); } else @@ -975,7 +968,7 @@ static void do_set_multicast_list(struct net_device *dev) if(dev->flags&IFF_PROMISC) ei_outb_p(E8390_RXCONFIG | 0x18, e8390_base + EN0_RXCR); - else if(dev->flags&IFF_ALLMULTI || dev->mc_list) + else if (dev->flags & IFF_ALLMULTI || !netdev_mc_empty(dev)) ei_outb_p(E8390_RXCONFIG | 0x08, e8390_base + EN0_RXCR); else ei_outb_p(E8390_RXCONFIG, e8390_base + EN0_RXCR); |