Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc1f4470 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller
Browse files

net: make ndo_get_stats64 a void function



The network device operation for reading statistics is only called
in one place, and it ignores the return value. Having a structure
return value is potentially confusing because some future driver could
incorrectly assume that the return value was used.

Fix all drivers with ndo_get_stats64 to have a void function.

Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 63c64de7
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ static int lacp_fast;

static int bond_init(struct net_device *bond_dev);
static void bond_uninit(struct net_device *bond_dev);
static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
static void bond_get_stats(struct net_device *bond_dev,
			   struct rtnl_link_stats64 *stats);
static void bond_slave_arr_handler(struct work_struct *work);
static bool bond_time_in_interval(struct bonding *bond, unsigned long last_act,
@@ -3337,7 +3337,7 @@ static void bond_fold_stats(struct rtnl_link_stats64 *_res,
	}
}

static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
static void bond_get_stats(struct net_device *bond_dev,
			   struct rtnl_link_stats64 *stats)
{
	struct bonding *bond = netdev_priv(bond_dev);
@@ -3362,8 +3362,6 @@ static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,

	memcpy(&bond->bond_stats, stats, sizeof(*stats));
	spin_unlock(&bond->stats_lock);

	return stats;
}

static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
+2 −3
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ struct pcpu_dstats {
	struct u64_stats_sync	syncp;
};

static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev,
static void dummy_get_stats64(struct net_device *dev,
			      struct rtnl_link_stats64 *stats)
{
	int i;
@@ -73,7 +73,6 @@ static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev,
		stats->tx_bytes += tbytes;
		stats->tx_packets += tpackets;
	}
	return stats;
}

static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev)
+2 −4
Original line number Diff line number Diff line
@@ -1471,7 +1471,7 @@ static netdev_tx_t slic_xmit(struct sk_buff *skb, struct net_device *dev)
	return NETDEV_TX_OK;
}

static struct rtnl_link_stats64 *slic_get_stats(struct net_device *dev,
static void slic_get_stats(struct net_device *dev,
			   struct rtnl_link_stats64 *lst)
{
	struct slic_device *sdev = netdev_priv(dev);
@@ -1489,8 +1489,6 @@ static struct rtnl_link_stats64 *slic_get_stats(struct net_device *dev,
	SLIC_GET_STATS_COUNTER(lst->rx_crc_errors, stats, rx_crc);
	SLIC_GET_STATS_COUNTER(lst->rx_fifo_errors, stats, rx_oflow802);
	SLIC_GET_STATS_COUNTER(lst->tx_carrier_errors, stats, tx_carrier);

	return lst;
}

static int slic_get_sset_count(struct net_device *dev, int sset)
+4 −6
Original line number Diff line number Diff line
@@ -2165,7 +2165,7 @@ static void ena_config_debug_area(struct ena_adapter *adapter)
	ena_com_delete_debug_area(adapter->ena_dev);
}

static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev,
static void ena_get_stats64(struct net_device *netdev,
			    struct rtnl_link_stats64 *stats)
{
	struct ena_adapter *adapter = netdev_priv(netdev);
@@ -2173,11 +2173,11 @@ static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev,
	int rc;

	if (!test_bit(ENA_FLAG_DEV_UP, &adapter->flags))
		return NULL;
		return;

	rc = ena_com_get_dev_basic_stats(adapter->ena_dev, &ena_stats);
	if (rc)
		return NULL;
		return;

	stats->tx_bytes = ((u64)ena_stats.tx_bytes_high << 32) |
		ena_stats.tx_bytes_low;
@@ -2204,8 +2204,6 @@ static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev,

	stats->rx_errors = 0;
	stats->tx_errors = 0;

	return stats;
}

static const struct net_device_ops ena_netdev_ops = {
+2 −4
Original line number Diff line number Diff line
@@ -1759,7 +1759,7 @@ static void xgbe_tx_timeout(struct net_device *netdev)
	schedule_work(&pdata->restart_work);
}

static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
static void xgbe_get_stats64(struct net_device *netdev,
			     struct rtnl_link_stats64 *s)
{
	struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -1786,8 +1786,6 @@ static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
	s->tx_dropped = netdev->stats.tx_dropped;

	DBGPR("<--%s\n", __func__);

	return s;
}

static int xgbe_vlan_rx_add_vid(struct net_device *netdev, __be16 proto,
Loading