[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1357575542.2658.1.camel@bwh-desktop.uk.solarflarecom.com>
Date: Mon, 7 Jan 2013 16:19:02 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: Jiri Pirko <jiri@...nulli.us>
CC: <netdev@...r.kernel.org>, <davem@...emloft.net>,
<richardcochran@...il.com>, <greearb@...delatech.com>,
<jeffrey.t.kirsher@...el.com>
Subject: Re: [patch net-next] ethtool: consolidate work with ethtool_ops
On Mon, 2013-01-07 at 13:26 +0100, Jiri Pirko wrote:
> No need to check if ethtool_ops == NULL since it can't be.
> Use local variable "ops" in functions where it is present
> instead of dev->ethtool_ops
> Introduce local variable "ops" in functions where dev->ethtool_ops is used
> many times.
>
> Signed-off-by: Jiri Pirko <jiri@...nulli.us>
> ---
> net/core/ethtool.c | 45 +++++++++++++++++++++------------------------
> 1 file changed, 21 insertions(+), 24 deletions(-)
>
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index a870543..08c213e 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
[...]
> @@ -1082,9 +1083,10 @@ static int ethtool_phys_id(struct net_device *dev, void __user *useraddr)
> {
> struct ethtool_value id;
> static bool busy;
> + const struct ethtool_ops *ops = dev->ethtool_ops;
> int rc;
>
> - if (!dev->ethtool_ops->set_phys_id)
> + if (ops->set_phys_id)
> return -EOPNOTSUPP;
[...]
This condition is inverted.
Ben.
--
Ben Hutchings, Staff 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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists