Subject: Re: [PATCH v1 net-next 3/9] lan743x: Add support for ethtool statistics

From: Andrew Lunn <[email-masked]>
Date: Thu, 5 Jul 2018 19:20:16 +0200

Hi Bryan

> +static void lan743x_ethtool_get_ethtool_stats(struct net_device *netdev,
> +					      struct ethtool_stats *stats,
> +					      u64 *data)
> +{
> +	struct lan743x_adapter *adapter = netdev_priv(netdev);
> +	int data_index = 0;
> +	u32 buf;
> +	int i;
> +
> +	for (i = 0; i < (sizeof(lan743x_set0_hw_cnt_addr) / (sizeof(u32)));

ARRAY_SIZE(lan743x_set0_hw_cnt_addr) ?

> +	     i++) {
> +		buf = lan743x_csr_read(adapter, lan743x_set0_hw_cnt_addr[i]);
> +		data[data_index++] = (u64)buf;
> +	}
> +	for (i = 0; i < 4; i++)

ARRAY_SIZE(lan743x_set1_sw_cnt_strings) ??

> +		data[data_index++] = (u64)(adapter->rx[i].frame_count);
> +	for (i = 0; i < (sizeof(lan743x_set2_hw_cnt_addr) / (sizeof(u32)));

ARRAY_SIZE()

> +	     i++) {
> +		buf = lan743x_csr_read(adapter, lan743x_set2_hw_cnt_addr[i]);
> +		data[data_index++] = (u64)buf;
> +	}
> +}

  Andrew