All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>,
	Amit Salecha <amit.salecha@qlogic.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Amerigo Wang <amwang@redhat.com>,
	Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Subject: Re: [RFC] [PATCH] ethtool: Change ethtool_op_set_flags to validate flags
Date: Wed, 30 Jun 2010 01:26:54 -0400	[thread overview]
Message-ID: <4C2AD59E.10008@garzik.org> (raw)
In-Reply-To: <1277827261.2112.48.camel@achroite.uk.solarflarecom.com>

On 06/29/2010 12:01 PM, Ben Hutchings wrote:
> This is the sort of change I'd like to see.
>
> Ben.
>
> ---
> ethtool_op_set_flags() does not check for unsupported flags, and has
> no way of doing so.  This means it is not suitable for use as a
> default implementation of ethtool_ops::set_flags.
>
> Add a 'supported' parameter specifying the flags that the driver and
> hardware support, validate the requested flags against this, and
> change all current callers to pass this parameter.
>
> Change some other trivial implementations of ethtool_ops::set_flags to
> call ethtool_op_set_flags().
> ---
>   drivers/net/cxgb4/cxgb4_main.c    |    9 +--------
>   drivers/net/enic/enic_main.c      |    1 -
>   drivers/net/ixgbe/ixgbe_ethtool.c |    5 ++++-
>   drivers/net/mv643xx_eth.c         |    7 ++++++-
>   drivers/net/myri10ge/myri10ge.c   |   10 +++++++---
>   drivers/net/niu.c                 |    9 +--------
>   drivers/net/sfc/ethtool.c         |    5 +----
>   drivers/net/sky2.c                |   16 ++++++----------
>   include/linux/ethtool.h           |    2 +-
>   net/core/ethtool.c                |   28 +++++-----------------------
>   10 files changed, 32 insertions(+), 60 deletions(-)

Acked-by: Jeff Garzik <jgarzik@redhat.com>

I think that's a better way to do it...



  reply	other threads:[~2010-06-30  5:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-28  9:31 [PATCH -next] qlcnic: fail when try to setup unsupported features Stanislaw Gruszka
2010-06-28 12:36 ` Amit Salecha
2010-06-28 12:58   ` Stanislaw Gruszka
2010-06-28 13:09     ` Amit Salecha
2010-06-28 14:14       ` Stanislaw Gruszka
2010-06-28 14:18         ` Ben Hutchings
2010-06-29 14:41           ` Ben Hutchings
2010-06-29 15:00             ` Stanislaw Gruszka
2010-06-29 15:05               ` Ben Hutchings
2010-06-29 16:01                 ` [RFC] [PATCH] ethtool: Change ethtool_op_set_flags to validate flags Ben Hutchings
2010-06-30  5:26                   ` Jeff Garzik [this message]
2010-06-30 11:21                   ` Stanislaw Gruszka
2010-06-30 20:47                     ` David Miller
2010-06-29 16:59             ` [PATCH -next] qlcnic: fail when try to setup unsupported features David Miller
2010-06-28 13:16     ` Ben Hutchings
2010-06-28 13:30       ` Ben Hutchings
2010-06-28 14:18         ` Stanislaw Gruszka
2010-06-29  7:55 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C2AD59E.10008@garzik.org \
    --to=jeff@garzik.org \
    --cc=amit.salecha@qlogic.com \
    --cc=amwang@redhat.com \
    --cc=anirban.chakraborty@qlogic.com \
    --cc=bhutchings@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=sgruszka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.