tokenring: convert to use netdev_for_each_mc_addr
authorJiri Pirko <jpirko@redhat.com>
Thu, 18 Feb 2010 02:47:07 +0000 (02:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Feb 2010 22:47:51 +0000 (14:47 -0800)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tokenring/3c359.c
drivers/net/tokenring/ibmtr.c
drivers/net/tokenring/lanstreamer.c
drivers/net/tokenring/olympic.c
drivers/net/tokenring/tms380tr.c

index eff68e1d107bbd712e3d7d3470f9364a6ea690ef..0fb930feea4566130fc3cc6dfc0816bb1c9a78cf 100644 (file)
@@ -1390,10 +1390,9 @@ static int xl_close(struct net_device *dev)
 static void xl_set_rx_mode(struct net_device *dev) 
 {
        struct xl_private *xl_priv = netdev_priv(dev);
-       struct dev_mc_list *dmi ; 
+       struct dev_mc_list *dmi;
        unsigned char dev_mc_address[4] ; 
        u16 options ; 
-       int i ; 
 
        if (dev->flags & IFF_PROMISC)
                options = 0x0004 ; 
@@ -1408,7 +1407,7 @@ static void xl_set_rx_mode(struct net_device *dev)
 
        dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ;
 
-        for (i=0,dmi=dev->mc_list;i < netdev_mc_count(dev); i++,dmi = dmi->next) {
+       netdev_for_each_mc_addr(dmi, dev) {
                 dev_mc_address[0] |= dmi->dmi_addr[2] ;
                 dev_mc_address[1] |= dmi->dmi_addr[3] ;
                 dev_mc_address[2] |= dmi->dmi_addr[4] ;
index 1ce8f85a89aadbbc5b16c9239c4b76a2aac700f9..1a0967246e2f01dbc6bf72c5aac4e8ce4f8c70ca 100644 (file)
@@ -995,13 +995,11 @@ static void tok_set_multicast_list(struct net_device *dev)
        /*BMS ifconfig tr down or hot unplug a PCMCIA card ??hownowbrowncow*/
        if (/*BMSHELPdev->start == 0 ||*/ ti->open_status != OPEN) return;
        address[0] = address[1] = address[2] = address[3] = 0;
-       mclist = dev->mc_list;
-       for (i = 0; i < netdev_mc_count(dev); i++) {
+       netdev_for_each_mc_addr(mclist, dev) {
                address[0] |= mclist->dmi_addr[2];
                address[1] |= mclist->dmi_addr[3];
                address[2] |= mclist->dmi_addr[4];
                address[3] |= mclist->dmi_addr[5];
-               mclist = mclist->next;
        }
        SET_PAGE(ti->srb_page);
        for (i = 0; i < sizeof(struct srb_set_funct_addr); i++)
index 26d84daf660b273840ae812561808a09aa2fb911..dd028fee9dc2d6a130895f6bdde2057a1b159c6e 100644 (file)
@@ -1268,7 +1268,6 @@ static void streamer_set_rx_mode(struct net_device *dev)
        __u8 options = 0;
        struct dev_mc_list *dmi;
        unsigned char dev_mc_address[5];
-       int i;
 
        writel(streamer_priv->srb, streamer_mmio + LAPA);
        options = streamer_priv->streamer_copy_all_options;
@@ -1303,8 +1302,7 @@ static void streamer_set_rx_mode(struct net_device *dev)
        writel(streamer_priv->srb,streamer_mmio+LAPA);
        dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ; 
   
-       for (i=0,dmi=dev->mc_list;i < netdev_mc_count(dev); i++,dmi = dmi->next)
-       { 
+       netdev_for_each_mc_addr(dmi, dev) {
                dev_mc_address[0] |= dmi->dmi_addr[2] ; 
                dev_mc_address[1] |= dmi->dmi_addr[3] ; 
                dev_mc_address[2] |= dmi->dmi_addr[4] ; 
index a242d125b34c5aeedbdb86d8a1c30940e38f03d1..3a25e0434ae2a62590a77d5303c6c6ecbdcde562 100644 (file)
@@ -1139,9 +1139,8 @@ static void olympic_set_rx_mode(struct net_device *dev)
        u8 __iomem *olympic_mmio = olympic_priv->olympic_mmio ; 
        u8 options = 0; 
        u8 __iomem *srb;
-       struct dev_mc_list *dmi ; 
+       struct dev_mc_list *dmi;
        unsigned char dev_mc_address[4] ; 
-       int i ; 
 
        writel(olympic_priv->srb,olympic_mmio+LAPA);
        srb=olympic_priv->olympic_lap + (olympic_priv->srb & (~0xf800));
@@ -1178,7 +1177,7 @@ static void olympic_set_rx_mode(struct net_device *dev)
 
        dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ; 
 
-       for (i=0,dmi=dev->mc_list;i < netdev_mc_count(dev); i++,dmi = dmi->next) {
+       netdev_for_each_mc_addr(dmi, dev) {
                dev_mc_address[0] |= dmi->dmi_addr[2] ; 
                dev_mc_address[1] |= dmi->dmi_addr[3] ; 
                dev_mc_address[2] |= dmi->dmi_addr[4] ; 
index 6b8868959b8584aa3fc62f4aa6b465f7a5480a89..21a01753312aa168055d5163af3d238c66d5b287 100644 (file)
@@ -1212,10 +1212,9 @@ static void tms380tr_set_multicast_list(struct net_device *dev)
                }
                else
                {
-                       int i;
-                       struct dev_mc_list *mclist = dev->mc_list;
-                       for (i=0; i< netdev_mc_count(dev); i++)
-                       {
+                       struct dev_mc_list *mclist;
+
+                       netdev_for_each_mc_addr(mclist, dev) {
                                ((char *)(&tp->ocpl.FunctAddr))[0] |=
                                        mclist->dmi_addr[2];
                                ((char *)(&tp->ocpl.FunctAddr))[1] |=
@@ -1224,7 +1223,6 @@ static void tms380tr_set_multicast_list(struct net_device *dev)
                                        mclist->dmi_addr[4];
                                ((char *)(&tp->ocpl.FunctAddr))[3] |=
                                        mclist->dmi_addr[5];
-                               mclist = mclist->next;
                        }
                }
                tms380tr_exec_cmd(dev, OC_SET_FUNCT_ADDR);