netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Neel Patel <neepatel@cisco.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] drivers/net: enic: Move ethtool code to a separate file
Date: Fri, 19 Jul 2013 13:38:12 -0700	[thread overview]
Message-ID: <1374266292.2059.11.camel@joe-AO722> (raw)
In-Reply-To: <20130719202817.13313.56725.stgit@savbu-picasso-lnx1.cisco.com>

On Fri, 2013-07-19 at 13:28 -0700, Neel Patel wrote:
> From: Neel Patel <neepatel@cisco.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/ ?

      reply	other threads:[~2013-07-19 20:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 20:28 [PATCH net-next] drivers/net: enic: Move ethtool code to a separate file Neel Patel
2013-07-19 20:38 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374266292.2059.11.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=neepatel@cisco.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).