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
@ -1492,10 +1492,10 @@ static void set_multicast_list(struct usbnet *usbdev)
|
||||
filter |= RNDIS_PACKET_TYPE_PROMISCUOUS |
|
||||
RNDIS_PACKET_TYPE_ALL_LOCAL;
|
||||
} else if (usbdev->net->flags & IFF_ALLMULTI ||
|
||||
usbdev->net->mc_count > priv->multicast_size) {
|
||||
netdev_mc_count(usbdev->net) > priv->multicast_size) {
|
||||
filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST;
|
||||
} else if (usbdev->net->mc_count > 0) {
|
||||
size = min(priv->multicast_size, usbdev->net->mc_count);
|
||||
} else if (!netdev_mc_empty(usbdev->net)) {
|
||||
size = min(priv->multicast_size, netdev_mc_count(usbdev->net));
|
||||
buf = kmalloc(size * ETH_ALEN, GFP_KERNEL);
|
||||
if (!buf) {
|
||||
devwarn(usbdev,
|
||||
|
Reference in New Issue
Block a user