[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMOZA0LiSV2WyzfHuU5=_g0Ru2z-osx0B-WkS-QHMaQeY4GXeA@mail.gmail.com>
Date: Wed, 22 Jan 2020 16:18:56 -0800
From: Luigi Rizzo <lrizzo@...gle.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Michal Kubecek <mkubecek@...e.cz>
Subject: Re: [PATCH] net-core: remove unnecessary ETHTOOL_GCHANNELS initialization
On Wed, Jan 22, 2020 at 3:47 PM Andrew Lunn <andrew@...n.ch> wrote:
>
> On Wed, Jan 22, 2020 at 02:33:26PM -0800, Luigi Rizzo wrote:
> > struct ethtool_channels does not need .cmd to be set when calling the
> > driver's ethtool methods. Just zero-initialize it.
> >
> > Tested: run ethtool -l and ethtool -L
>
> Hi Luigi
>
> This seems pretty risky. You are assuming ethtool is the only user of
> this API. What is actually wrong with putting a sane cmd value, rather
> than the undefined value 0.
Hi Andrew, if I understand correctly your suggestion is that even if
the values are
unused, it is better to stay compliant with the header file
include/uapi/linux/ethtool.h,
which does suggest a value for .cmd for the various structs, and only
replace the value
in ethtool_set_channels() with the correct one ETHTOOL_SCHANNELS ?
cheers
luigi
>
> Andrew
Powered by blists - more mailing lists