Re: [PATCH 1/5] ethtool: cosmetics: enforce const-ness inethtool_cmd_speed

From: Ben Hutchings
Date: Sat Apr 16 2011 - 22:06:23 EST


On Sat, 2011-04-16 at 17:54 -0700, David Decotigny wrote:
> The 'ep' argument of ethtool_cmd_speed is not altered: advertise it in
> protoype. +Indentation fix. Also add comments to advise using the
> ethtool_cmd_speed API to get/set the link speed.
>
> Signed-off-by: David Decotigny <decot@xxxxxxxxxx>
> ---
> include/linux/ethtool.h | 14 ++++++++++----
> 1 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 9de3127..170439e 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -24,7 +24,10 @@ struct ethtool_cmd {
> __u32 cmd;
> __u32 supported; /* Features this interface supports */
> __u32 advertising; /* Features this interface advertises */
> - __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
> + __u16 speed; /* The forced speed (lower bits): see
> + * SPEED_ macros below. Please use
> + * ethtool_cmd_speed()/_set() to
> + * access it */
[...]

Don't encourage use of the SPEED_* macros. The speed is just a value in
units of Mbit/s.

Ben.

--
Ben Hutchings, Senior Software Engineer, Solarflare
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 linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/