]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/enic/enic_main.c
net: convert multiple drivers to use netdev_for_each_mc_addr, part4
[mv-sheeva.git] / drivers / net / enic / enic_main.c
index c81bc4b1816f44a59d5fcd8048eaba5b451722ed..cf098bb636b802a48e0187218744e6461173d4ec 100644 (file)
@@ -822,16 +822,16 @@ static int enic_set_mac_addr(struct net_device *netdev, char *addr)
 static void enic_set_multicast_list(struct net_device *netdev)
 {
        struct enic *enic = netdev_priv(netdev);
-       struct dev_mc_list *list = netdev->mc_list;
+       struct dev_mc_list *list;
        int directed = 1;
        int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
        int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
        int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
+       unsigned int mc_count = netdev_mc_count(netdev);
        int allmulti = (netdev->flags & IFF_ALLMULTI) ||
-           (netdev->mc_count > ENIC_MULTICAST_PERFECT_FILTERS);
+                      mc_count > ENIC_MULTICAST_PERFECT_FILTERS;
        unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
        u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
-       unsigned int mc_count = netdev->mc_count;
        unsigned int i, j;
 
        if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS)
@@ -851,9 +851,11 @@ static void enic_set_multicast_list(struct net_device *netdev)
         * look for changes to add/del.
         */
 
-       for (i = 0; list && i < mc_count; i++) {
-               memcpy(mc_addr[i], list->dmi_addr, ETH_ALEN);
-               list = list->next;
+       i = 0;
+       netdev_for_each_mc_addr(list, netdev) {
+               if (i == mc_count)
+                       break;
+               memcpy(mc_addr[i++], list->dmi_addr, ETH_ALEN);
        }
 
        for (i = 0; i < enic->mc_count; i++) {