From: Kent Gibson <warthog618@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Hugo Villeneuve <hugo@hugovil.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
gregkh@linuxfoundation.org, jirislaby@kernel.org,
cosmin.tanislav@analog.com, shc_work@mail.ru,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
Hugo Villeneuve <hvilleneuve@dimonoff.com>
Subject: Re: [PATCH 15/18] serial: max310x: replace ENOTSUPP with preferred EOPNOTSUPP (checkpatch)
Date: Thu, 18 Jan 2024 21:15:44 +0800 [thread overview]
Message-ID: <20240118131544.GA151488@rigel> (raw)
In-Reply-To: <CAHp75Vc5mePmXaAbsex6=tHeLSfSj5gZiE4_DQ0-5R-4h6=U5w@mail.gmail.com>
On Thu, Jan 18, 2024 at 10:59:34AM +0200, Andy Shevchenko wrote:
> On Thu, Jan 18, 2024 at 1:59 AM Hugo Villeneuve <hugo@hugovil.com> wrote:
> > On Thu, 18 Jan 2024 01:24:11 +0200
> > Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > > On Thu, Jan 18, 2024 at 12:39 AM Hugo Villeneuve <hugo@hugovil.com> wrote:
>
> ...
>
> > > > Fixes the following checkpatch warning:
> > > >
> > > > WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
> > >
> > > NAK.
> > > It's a false positive.
> > >
> > > > According to include/linux/errno.h, ENOTSUPP is
> > > > "Defined for the NFSv3 protocol", so replace it with preferred EOPNOTSUPP.
> > >
> > > The GPIO subsystem uses this internal error code internally. User
> > > space won't get it, so users may not see this one.
> >
> > Hi Andy,
> > I will drop the patch then.
> >
> > What about adding a comment to prevent future fixes?
> >
> > - return -ENOTSUPP;
> > + return -ENOTSUPP; /*
> > + * ENOTSUPP is used for backward compatibility
> > + * with GPIO subsystem.
> > + */
>
> It's kinda useless to add it to a single (GPIO) driver.
> Rather it needs to be mentioned somewhere between
> https://www.kernel.org/doc/html/latest/driver-api/gpio/index.html.
>
> +Cc: Kent, Bart. It seems we have a handful of drivers violating this
> (basically following what checkpatch says) and GPIO not documenting
> this specific error code and its scope. Did I miss anything?
>
You are correct - the GPIO subsystem is expecting ENOTSUPP if the config
is not supported. In some cases it absorbs the failure or emulates the
feature instead (open drain/source, debounce). Returning EOPNOTSUPP
would be unfortunate, so checkpatch is not being helpful here.
And don't get me started on the gpio_chip interface contract being too
vague.
There are a handful of ways this could be addressed (documentation,
checkpatch, handle either, switch to EOPNOTSUPP, ... or some combination),
but making that call is definitely in Bart's court.
Cheers,
Kent.
next prev parent reply other threads:[~2024-01-18 13:15 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 22:38 [PATCH 00/18] serial: max310x: cleanups and improvements Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 01/18] serial: max310x: fix NULL pointer dereference in I2C instantiation Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 02/18] serial: max310x: add I2C device table for instantiation from userspace Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 03/18] serial: max310x: use i2c_get_match_data() Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 04/18] serial: max310x: use spi_get_device_match_data() Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 05/18] serial: max310x: fix syntax error in IRQ error message Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 06/18] serial: max310x: remove holes in struct max310x_devtype Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 07/18] serial: max310x: add macro for max number of ports Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 08/18] serial: max310x: use separate regmap name for each port Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 09/18] serial: max310x: simplify probe() and remove() error handling Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 10/18] serial: max310x: add explicit return for some switch default cases Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 11/18] serial: max310x: use dev_err_probe() instead of dev_err() Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 12/18] serial: max310x: replace hardcoded masks with preferred GENMASK() Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 13/18] serial: max310x: use common detect function for all variants Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 14/18] serial: max310x: use common power " Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 15/18] serial: max310x: replace ENOTSUPP with preferred EOPNOTSUPP (checkpatch) Hugo Villeneuve
2024-01-17 23:24 ` Andy Shevchenko
2024-01-17 23:59 ` Hugo Villeneuve
2024-01-18 8:59 ` Andy Shevchenko
2024-01-18 13:15 ` Kent Gibson [this message]
2024-01-17 22:38 ` [PATCH 16/18] serial: max310x: replace bare use of 'unsigned' with 'unsigned int' (checkpatch) Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 17/18] serial: max310x: reformat and improve comments Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 18/18] serial: max310x: fix indentation Hugo Villeneuve
2024-01-17 23:26 ` [PATCH 00/18] serial: max310x: cleanups and improvements Andy Shevchenko
2024-01-18 0:00 ` Hugo Villeneuve
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=20240118131544.GA151488@rigel \
--to=warthog618@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=brgl@bgdev.pl \
--cc=cosmin.tanislav@analog.com \
--cc=gregkh@linuxfoundation.org \
--cc=hugo@hugovil.com \
--cc=hvilleneuve@dimonoff.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=shc_work@mail.ru \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox