diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-17 23:02:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-18 17:47:50 -0500 |
commit | a92635dc77b14f0f28d45c0fbf91b5064d9d7617 (patch) | |
tree | efc3a7a9a4b559614e56339aaa26171495bfb0c9 /drivers/net/usb/asix.c | |
parent | 4302b67e041ea81c8fc233bee1296516e1294a27 (diff) |
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/asix.c')
-rw-r--r-- | drivers/net/usb/asix.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index f605204de3e5..20e34608fa4a 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -555,20 +555,18 @@ static void asix_set_multicast(struct net_device *net) | |||
555 | * for our 8 byte filter buffer | 555 | * for our 8 byte filter buffer |
556 | * to avoid allocating memory that | 556 | * to avoid allocating memory that |
557 | * is tricky to free later */ | 557 | * is tricky to free later */ |
558 | struct dev_mc_list *mc_list = net->mc_list; | 558 | struct dev_mc_list *mc_list; |
559 | u32 crc_bits; | 559 | u32 crc_bits; |
560 | int i; | ||
561 | 560 | ||
562 | memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); | 561 | memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); |
563 | 562 | ||
564 | /* Build the multicast hash filter. */ | 563 | /* Build the multicast hash filter. */ |
565 | for (i = 0; i < netdev_mc_count(net); i++) { | 564 | netdev_for_each_mc_addr(mc_list, net) { |
566 | crc_bits = | 565 | crc_bits = |
567 | ether_crc(ETH_ALEN, | 566 | ether_crc(ETH_ALEN, |
568 | mc_list->dmi_addr) >> 26; | 567 | mc_list->dmi_addr) >> 26; |
569 | data->multi_filter[crc_bits >> 3] |= | 568 | data->multi_filter[crc_bits >> 3] |= |
570 | 1 << (crc_bits & 7); | 569 | 1 << (crc_bits & 7); |
571 | mc_list = mc_list->next; | ||
572 | } | 570 | } |
573 | 571 | ||
574 | asix_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0, | 572 | asix_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0, |
@@ -769,20 +767,18 @@ static void ax88172_set_multicast(struct net_device *net) | |||
769 | * for our 8 byte filter buffer | 767 | * for our 8 byte filter buffer |
770 | * to avoid allocating memory that | 768 | * to avoid allocating memory that |
771 | * is tricky to free later */ | 769 | * is tricky to free later */ |
772 | struct dev_mc_list *mc_list = net->mc_list; | 770 | struct dev_mc_list *mc_list; |
773 | u32 crc_bits; | 771 | u32 crc_bits; |
774 | int i; | ||
775 | 772 | ||
776 | memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); | 773 | memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); |
777 | 774 | ||
778 | /* Build the multicast hash filter. */ | 775 | /* Build the multicast hash filter. */ |
779 | for (i = 0; i < netdev_mc_count(net); i++) { | 776 | netdev_for_each_mc_addr(mc_list, net) { |
780 | crc_bits = | 777 | crc_bits = |
781 | ether_crc(ETH_ALEN, | 778 | ether_crc(ETH_ALEN, |
782 | mc_list->dmi_addr) >> 26; | 779 | mc_list->dmi_addr) >> 26; |
783 | data->multi_filter[crc_bits >> 3] |= | 780 | data->multi_filter[crc_bits >> 3] |= |
784 | 1 << (crc_bits & 7); | 781 | 1 << (crc_bits & 7); |
785 | mc_list = mc_list->next; | ||
786 | } | 782 | } |
787 | 783 | ||
788 | asix_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0, | 784 | asix_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0, |