net: use netdev_mc_count and netdev_mc_empty when appropriate
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss anything). Used spatch and did small tweaks and conding style changes when it was suitable. Jirka 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
8e5574211d
commit
4cd24eaf0c
@@ -1981,7 +1981,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
|
||||
}
|
||||
ehea_allmulti(dev, 0);
|
||||
|
||||
if (dev->mc_count) {
|
||||
if (!netdev_mc_empty(dev)) {
|
||||
ret = ehea_drop_multicast_list(dev);
|
||||
if (ret) {
|
||||
/* Dropping the current multicast list failed.
|
||||
@@ -1990,14 +1990,14 @@ static void ehea_set_multicast_list(struct net_device *dev)
|
||||
ehea_allmulti(dev, 1);
|
||||
}
|
||||
|
||||
if (dev->mc_count > port->adapter->max_mc_mac) {
|
||||
if (netdev_mc_count(dev) > port->adapter->max_mc_mac) {
|
||||
ehea_info("Mcast registration limit reached (0x%llx). "
|
||||
"Use ALLMULTI!",
|
||||
port->adapter->max_mc_mac);
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (i = 0, k_mcl_entry = dev->mc_list; i < dev->mc_count; i++,
|
||||
for (i = 0, k_mcl_entry = dev->mc_list; i < netdev_mc_count(dev); i++,
|
||||
k_mcl_entry = k_mcl_entry->next)
|
||||
ehea_add_multicast_entry(port, k_mcl_entry->dmi_addr);
|
||||
|
||||
|
Reference in New Issue
Block a user