aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-08 04:30:35 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-12 11:38:58 -0800
commit4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 (patch)
tree99f57f6374a58022e1e5ed1cbc12699288c7eae1 /drivers/net/virtio_net.c
parent8e5574211d96c0552f84c757718475fdb4021be7 (diff)
downloadkernel_samsung_aries-4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5.zip
kernel_samsung_aries-4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5.tar.gz
kernel_samsung_aries-4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5.tar.bz2
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>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 9d8984a..4c347a3 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -735,6 +735,7 @@ static void virtnet_set_rx_mode(struct net_device *dev)
struct dev_addr_list *addr;
struct netdev_hw_addr *ha;
int uc_count;
+ int mc_count;
void *buf;
int i;
@@ -762,9 +763,11 @@ static void virtnet_set_rx_mode(struct net_device *dev)
allmulti ? "en" : "dis");
uc_count = netdev_uc_count(dev);
+ mc_count = netdev_mc_count(dev);
/* MAC filter - use one buffer for both lists */
- mac_data = buf = kzalloc(((uc_count + dev->mc_count) * ETH_ALEN) +
- (2 * sizeof(mac_data->entries)), GFP_ATOMIC);
+ buf = kzalloc(((uc_count + mc_count) * ETH_ALEN) +
+ (2 * sizeof(mac_data->entries)), GFP_ATOMIC);
+ mac_data = buf;
if (!buf) {
dev_warn(&dev->dev, "No memory for MAC address buffer\n");
return;
@@ -784,13 +787,13 @@ static void virtnet_set_rx_mode(struct net_device *dev)
/* multicast list and count fill the end */
mac_data = (void *)&mac_data->macs[uc_count][0];
- mac_data->entries = dev->mc_count;
+ mac_data->entries = mc_count;
addr = dev->mc_list;
- for (i = 0; i < dev->mc_count; i++, addr = addr->next)
+ for (i = 0; i < mc_count; i++, addr = addr->next)
memcpy(&mac_data->macs[i][0], addr->da_addr, ETH_ALEN);
sg_set_buf(&sg[1], mac_data,
- sizeof(mac_data->entries) + (dev->mc_count * ETH_ALEN));
+ sizeof(mac_data->entries) + (mc_count * ETH_ALEN));
if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_MAC,
VIRTIO_NET_CTRL_MAC_TABLE_SET,