[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56B32FD8.7020407@cumulusnetworks.com>
Date: Thu, 4 Feb 2016 12:02:48 +0100
From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
To: Stephen Hemminger <stephen@...workplumber.org>,
Nikolay Aleksandrov <razor@...ckwall.org>
Cc: netdev@...r.kernel.org, mst@...hat.com, roopa@...ulusnetworks.com,
davem@...emloft.net
Subject: Re: [PATCH net-next v5 1/2] ethtool: add speed/duplex validation
functions
On 02/04/2016 12:32 AM, Stephen Hemminger wrote:
> On Wed, 3 Feb 2016 04:04:36 +0100
> Nikolay Aleksandrov <razor@...ckwall.org> wrote:
>
>>
>> +static inline int ethtool_validate_speed(__u32 speed)
>> +{
>
>
> No need for inline.
>
This is defined in a header, if it's not inline you start getting
"defined but not used" warnings.
> But why check for valid value at all. At some point in the
> future, there will be yet another speed adopted by some standard body
> and the switch statement would need another value.
>
> Why not accept any value? This is a virtual device.
>
It was moved near the defined values so everyone adding a new speed would
remember to update the validation function as well. That being said, I don't
object to being able to set any custom speed to the virtio_net device especially
when there're physical devices that can have speeds outside of these defines.
Michael do you have any objections if I respin without the speed validation ?
Thanks,
Nik
Powered by blists - more mailing lists