All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Sabrina Dubroca <sd@queasysnail.net>, netdev@vger.kernel.org
Subject: Re: Use of ENOTSUPP in drivers?
Date: Sun, 12 Jan 2014 13:19:36 -0800	[thread overview]
Message-ID: <1408352.Qio0cxKTUV@lenovo> (raw)
In-Reply-To: <1389559622.3720.115.camel@deadeye.wl.decadent.org.uk>

Le dimanche 12 janvier 2014, 20:47:02 Ben Hutchings a écrit :
> On Sun, 2014-01-12 at 19:57 +0100, Sabrina Dubroca wrote:
> > Thu, 2 Jan 2014 12:01:31 +0000, Ben Hutchings wrote:
> > > Never return error code ENOTSUPP; it's *not* the same thing as ENOTSUP
> > > in userland and is not part of the userland ABI.  I would use EINVAL
> > > here.
> > 
> > I've found a few ethernet drivers that return -ENOTSUPP in various
> > functions. In particular, some ethtool functions or ioctl's.
> > Ben's message makes me think that the ethtool functions and ioctl's
> > should be modified.
> > 
> > There are other occurences, mostly in functions related to device
> > initialization. I didn't manage to track down exactly from where some
> > of them are called, and I don't know if ENOTSUPP is okay in these.
> > 
> > I've included the complete list of occurences (based on net-next) from
> > drivers/net/ethernet in patch form at the end, if that's more
> > convenient than the file/function list. This is not meant to be
> > applied.
> > 
> > 
> > Do these (or part of them) need to be patched? Or is there something
> > I'm missing?
> 
> [...]
> 
> I believe they should all be patched.  According to
> include/linux/errno.h, ENOTSUPP is meant for use in the NFSv3 code only.
> (But it's apparently erroneously used *all over* the tree, not just in
> net drivers!)

Most other drivers use -EOPNOTSUPP, which is arguably as bad as -ENOTSUPP, 
since the comment about it says:

* Operation not supported on transport endpoint *

But at least changing -ENOTSUPP to -EOPNOTSUPP until something better which is 
not protocol/endpoint specific is agreed on might be better for consistency?
-- 
Florian

  reply	other threads:[~2014-01-12 21:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-12 18:57 Use of ENOTSUPP in drivers? Sabrina Dubroca
2014-01-12 20:47 ` Ben Hutchings
2014-01-12 21:19   ` Florian Fainelli [this message]
2014-01-12 21:39     ` Ben Hutchings
2014-01-13  9:41   ` David Laight
2014-01-13  6:45 ` Shahed Shaikh

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=1408352.Qio0cxKTUV@lenovo \
    --to=f.fainelli@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    /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.