[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1267712797.2819.149.camel@localhost>
Date: Thu, 04 Mar 2010 14:26:37 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc: davem@...emloft.net, jeff@...zik.org, netdev@...r.kernel.org,
gospo@...hat.com
Subject: Re: [PATCH v4] ethtool: Add direct access to ops->get_sset_count
On Thu, 2010-03-04 at 00:51 -0800, Jeff Kirsher wrote:
> From: Jeff Garzik <jgarzik@...hat.com>
>
> This patch is an alternative approach for accessing string
> counts, vs. the drvinfo indirect approach. This way the drvinfo
> space doesn't run out, and we don't break ABI later.
[...]
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -214,6 +214,10 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use
> info.cmd = ETHTOOL_GDRVINFO;
> ops->get_drvinfo(dev, &info);
>
> + /*
> + * this method of obtaining string set info is deprecated;
> + * consider using ETHTOOL_GSSET_INFO instead
> + */
This comment belongs on the interface (ethtool.h) not the
implementation.
[...]
> +static noinline int ethtool_get_sset_info(struct net_device *dev,
> + void __user *useraddr)
> +{
[...]
> + /* calculate size of return buffer */
> + for (i = 0; i < 64; i++)
> + if (sset_mask & (1ULL << i))
> + n_bits++;
[...]
We have a function for this:
n_bits = hweight64(sset_mask);
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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