From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: Joe Perches <joe@perches.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] gpiolib: Allow drivers to return EOPNOTSUPP from config
Date: Mon, 29 Mar 2021 16:30:14 +0300 [thread overview]
Message-ID: <YGHWZuNfbSDe+B6y@smile.fi.intel.com> (raw)
In-Reply-To: <bf12f668db2f0dce7dfc09351780e295da30714c.camel@fi.rohmeurope.com>
On Mon, Mar 29, 2021 at 03:20:07PM +0300, Matti Vaittinen wrote:
> On Mon, 2021-03-29 at 14:59 +0300, Andy Shevchenko wrote:
> > On Mon, Mar 29, 2021 at 2:43 PM Matti Vaittinen
> > <matti.vaittinen@fi.rohmeurope.com> wrote:
> > > The checkpacth instructs to switch from ENOSUPP to EOPNOTSUPP.
> > > > WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
> > >
> > > Make the gpiolib allow drivers to return both so driver developers
> > > can avoid one of the checkpatch complaints.
> >
> > Internally we are fine to use the ENOTSUPP.
> > Checkpatch false positives there.
>
> I agree. OTOH, the checkpatch check makes sense to user-visible stuff.
> Yet, the checkpatch has hard time guessing what is user-visible - so it
> probably is easiest to nag about all ENOTSUPP uses as it does now.
>
> > I doubt we need this change. Rather checkpatch should rephrase this
> > to
> > point out that this is only applicable to _user-visible_ error path.
> > Cc'ed Joe.
>
> Yes, thanks for pulling Joe in.
>
> Anyways, no matter what the warning says, all false positives are
> annoying. I don't see why we should stay with ENOTSUPP in gpiolib?
> (other than the burden of changing it).
For sake of the changing we are not changing the code.
> But I have no strong opinion on this. All options I see have downsides.
>
> Accepting both ENOTSUPP and EOPNOTSUPP is the easy way to avoid
> allowing checkpatch warnings - but I admit it isn't stylish.
I think the error code which is Linux kernel internal is for a reason.
> Converting all ENOTSUPP cases inside gpiolib to EOPNOTSUPP is teodious
> although end result might be nicer.
Why? You still missed the justification except satisfying some tool that gives
you false positives. We don't do that. It's the tool that has to be fixed /
amended.
> Leaving it as is gives annoying false-positives to driver developers.
>
> My personal preference was this patch - others can have other view like
> Andy does. I'll leave this to community/maintainers to evaluate :)
This patch misses documentation fixes, for example.
Also, do you suggest that we have to do the same in entire pin control
subsystem?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-03-29 13:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-29 11:40 [PATCH 0/2] gpiolib: misc fixups Matti Vaittinen
2021-03-29 11:41 ` [PATCH 1/2] gpio: sysfs: Obey valid_mask Matti Vaittinen
2021-03-29 11:56 ` Andy Shevchenko
2021-03-31 7:56 ` Bartosz Golaszewski
2021-03-31 12:25 ` Andy Shevchenko
2021-03-31 18:29 ` Bartosz Golaszewski
2021-04-01 3:56 ` Matti Vaittinen
2021-03-29 11:41 ` [PATCH 2/2] gpiolib: Allow drivers to return EOPNOTSUPP from config Matti Vaittinen
2021-03-29 11:59 ` Andy Shevchenko
2021-03-29 12:20 ` Matti Vaittinen
2021-03-29 13:30 ` Andy Shevchenko [this message]
2021-03-30 4:32 ` Matti Vaittinen
2021-03-30 10:19 ` Andy Shevchenko
2021-03-31 8:10 ` Bartosz Golaszewski
2021-03-29 15:08 ` Joe Perches
2021-03-29 15:25 ` Andy Shevchenko
2021-03-29 17:46 ` Jakub Kicinski
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=YGHWZuNfbSDe+B6y@smile.fi.intel.com \
--to=andy.shevchenko@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=joe@perches.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=sboyd@codeaurora.org \
/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