[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200607161232.GE1022955@lunn.ch>
Date: Sun, 7 Jun 2020 18:12:32 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Amit Cohen <amitc@...lanox.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
corbet@....net, jiri@...lanox.com, idosch@...lanox.com,
shuah@...nel.org, mkubecek@...e.cz, gustavo@...eddedor.com,
cforno12@...ux.vnet.ibm.com, f.fainelli@...il.com,
linux@...pel-privat.de, alexandru.ardelean@...log.com,
ayal@...lanox.com, petrm@...lanox.com, mlxsw@...lanox.com,
liuhangbin@...il.com, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [RFC PATCH net-next 04/10] ethtool: Add link extended state
> +static void linkstate_get_ext_state(struct net_device *dev,
> + struct linkstate_reply_data *data)
> +{
> + int err;
> +
> + if (!dev->ethtool_ops->get_ext_state)
> + return;
> +
> + err = dev->ethtool_ops->get_ext_state(dev, &data->ethtool_ext_state_info);
> + if (err) {
> + data->ext_state_provided = false;
> + return;
> + }
> +
> + data->ext_state_provided = true;
> }
A void function is rather odd for this sort of thing. It is much more
normal to return an error code, -EOPNOTSUPP if the op is not available,
or 0 if it all went well.
Andrew
Powered by blists - more mailing lists