[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160204105307.62e6c934@samsung9>
Date: Thu, 4 Feb 2016 10:53:07 +1100
From: Stephen Hemminger <stephen@...workplumber.org>
To: Nikolay Aleksandrov <razor@...ckwall.org>
Cc: netdev@...r.kernel.org, davem@...emloft.net,
Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
Roopa Prabhu <roopa@...ulusnetworks.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH net-next] virtio_net: add ethtool support for set and
get of settings
On Tue, 2 Feb 2016 13:51:20 +0100
Nikolay Aleksandrov <razor@...ckwall.org> wrote:
> +static bool virtnet_validate_speed(u32 speed)
> +{
> + switch (speed) {
> + case SPEED_10:
> + case SPEED_100:
> + case SPEED_1000:
> + case SPEED_2500:
> + case SPEED_5000:
> + case SPEED_10000:
> + case SPEED_20000:
> + case SPEED_25000:
> + case SPEED_40000:
> + case SPEED_50000:
> + case SPEED_56000:
> + case SPEED_100000:
> + case SPEED_UNKNOWN:
> + return true;
> + }
> +
> + return false;
> +}
Why limit to only known values. This switch() will get out of
date when some vendor introduces 64G or some other weird value.
Powered by blists - more mailing lists