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>
This commit is contained in:

committed by
David S. Miller

parent
4302b67e04
commit
a92635dc77
@@ -555,20 +555,18 @@ static void asix_set_multicast(struct net_device *net)
|
||||
* for our 8 byte filter buffer
|
||||
* to avoid allocating memory that
|
||||
* is tricky to free later */
|
||||
struct dev_mc_list *mc_list = net->mc_list;
|
||||
struct dev_mc_list *mc_list;
|
||||
u32 crc_bits;
|
||||
int i;
|
||||
|
||||
memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
|
||||
|
||||
/* Build the multicast hash filter. */
|
||||
for (i = 0; i < netdev_mc_count(net); i++) {
|
||||
netdev_for_each_mc_addr(mc_list, net) {
|
||||
crc_bits =
|
||||
ether_crc(ETH_ALEN,
|
||||
mc_list->dmi_addr) >> 26;
|
||||
data->multi_filter[crc_bits >> 3] |=
|
||||
1 << (crc_bits & 7);
|
||||
mc_list = mc_list->next;
|
||||
}
|
||||
|
||||
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)
|
||||
* for our 8 byte filter buffer
|
||||
* to avoid allocating memory that
|
||||
* is tricky to free later */
|
||||
struct dev_mc_list *mc_list = net->mc_list;
|
||||
struct dev_mc_list *mc_list;
|
||||
u32 crc_bits;
|
||||
int i;
|
||||
|
||||
memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
|
||||
|
||||
/* Build the multicast hash filter. */
|
||||
for (i = 0; i < netdev_mc_count(net); i++) {
|
||||
netdev_for_each_mc_addr(mc_list, net) {
|
||||
crc_bits =
|
||||
ether_crc(ETH_ALEN,
|
||||
mc_list->dmi_addr) >> 26;
|
||||
data->multi_filter[crc_bits >> 3] |=
|
||||
1 << (crc_bits & 7);
|
||||
mc_list = mc_list->next;
|
||||
}
|
||||
|
||||
asix_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
|
||||
|
Reference in New Issue
Block a user