[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1374266292.2059.11.camel@joe-AO722>
Date: Fri, 19 Jul 2013 13:38:12 -0700
From: Joe Perches <joe@...ches.com>
To: Neel Patel <neepatel@...co.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next] drivers/net: enic: Move ethtool code to a
separate file
On Fri, 2013-07-19 at 13:28 -0700, Neel Patel wrote:
> From: Neel Patel <neepatel@...co.com>
Hi Neel.
> This patch moves all enic ethtool hooks from enic_main.c to a new file
> enic_ethtool.c
These comments aren't for new issues and are trivial.
> diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
[]
> +struct enic_stat {
> + char name[ETH_GSTRING_LEN];
> + unsigned int offset;
> +};
Offset is really an index, so use index
> +#define ENIC_TX_STAT(stat) \
> + { .name = #stat, .offset = offsetof(struct vnic_tx_stats, stat) / 8 }
> +#define ENIC_RX_STAT(stat) \
> + { .name = #stat, .offset = offsetof(struct vnic_rx_stats, stat) / 8 }
index = offsetof(struct, stat) / sizeof(struct.stat)
to avoid use of 8?
> +static void enic_get_ethtool_stats(struct net_device *netdev,
> + struct ethtool_stats *stats, u64 *data)
> +{
[]
> + for (i = 0; i < enic_n_tx_stats; i++)
> + *(data++) = ((u64 *)&vstats->tx)[enic_tx_stats[i].offset];
> + for (i = 0; i < enic_n_rx_stats; i++)
> + *(data++) = ((u64 *)&vstats->rx)[enic_rx_stats[i].offset];
s/offset/index/ ?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists