diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-07 23:30:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-12 14:38:58 -0500 |
commit | 4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 (patch) | |
tree | 99f57f6374a58022e1e5ed1cbc12699288c7eae1 /drivers/net/vmxnet3 | |
parent | 8e5574211d96c0552f84c757718475fdb4021be7 (diff) |
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/vmxnet3')
-rw-r--r-- | drivers/net/vmxnet3/vmxnet3_drv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index b896f9386110..ee1b397417f3 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -1668,7 +1668,7 @@ static u8 * | |||
1668 | vmxnet3_copy_mc(struct net_device *netdev) | 1668 | vmxnet3_copy_mc(struct net_device *netdev) |
1669 | { | 1669 | { |
1670 | u8 *buf = NULL; | 1670 | u8 *buf = NULL; |
1671 | u32 sz = netdev->mc_count * ETH_ALEN; | 1671 | u32 sz = netdev_mc_count(netdev) * ETH_ALEN; |
1672 | 1672 | ||
1673 | /* struct Vmxnet3_RxFilterConf.mfTableLen is u16. */ | 1673 | /* struct Vmxnet3_RxFilterConf.mfTableLen is u16. */ |
1674 | if (sz <= 0xffff) { | 1674 | if (sz <= 0xffff) { |
@@ -1678,7 +1678,7 @@ vmxnet3_copy_mc(struct net_device *netdev) | |||
1678 | int i; | 1678 | int i; |
1679 | struct dev_mc_list *mc = netdev->mc_list; | 1679 | struct dev_mc_list *mc = netdev->mc_list; |
1680 | 1680 | ||
1681 | for (i = 0; i < netdev->mc_count; i++) { | 1681 | for (i = 0; i < netdev_mc_count(netdev); i++) { |
1682 | BUG_ON(!mc); | 1682 | BUG_ON(!mc); |
1683 | memcpy(buf + i * ETH_ALEN, mc->dmi_addr, | 1683 | memcpy(buf + i * ETH_ALEN, mc->dmi_addr, |
1684 | ETH_ALEN); | 1684 | ETH_ALEN); |
@@ -1708,12 +1708,12 @@ vmxnet3_set_mc(struct net_device *netdev) | |||
1708 | if (netdev->flags & IFF_ALLMULTI) | 1708 | if (netdev->flags & IFF_ALLMULTI) |
1709 | new_mode |= VMXNET3_RXM_ALL_MULTI; | 1709 | new_mode |= VMXNET3_RXM_ALL_MULTI; |
1710 | else | 1710 | else |
1711 | if (netdev->mc_count > 0) { | 1711 | if (!netdev_mc_empty(netdev)) { |
1712 | new_table = vmxnet3_copy_mc(netdev); | 1712 | new_table = vmxnet3_copy_mc(netdev); |
1713 | if (new_table) { | 1713 | if (new_table) { |
1714 | new_mode |= VMXNET3_RXM_MCAST; | 1714 | new_mode |= VMXNET3_RXM_MCAST; |
1715 | rxConf->mfTableLen = cpu_to_le16( | 1715 | rxConf->mfTableLen = cpu_to_le16( |
1716 | netdev->mc_count * ETH_ALEN); | 1716 | netdev_mc_count(netdev) * ETH_ALEN); |
1717 | rxConf->mfTablePA = cpu_to_le64(virt_to_phys( | 1717 | rxConf->mfTablePA = cpu_to_le64(virt_to_phys( |
1718 | new_table)); | 1718 | new_table)); |
1719 | } else { | 1719 | } else { |