[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ceb7dc5c2fa376470ab9274020fddf1c2f1584f.camel@perches.com>
Date: Mon, 29 Mar 2021 08:08:52 -0700
From: Joe Perches <joe@...ches.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>,
Matti Vaittinen <matti.vaittinen@...rohmeurope.com>,
Jakub Kicinski <kuba@...nel.org>
Cc: Matti Vaittinen <mazziesaccount@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Stephen Boyd <sboyd@...eaurora.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] gpiolib: Allow drivers to return EOPNOTSUPP from
config
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@...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 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.
Adding CC for Jakub Kicinski who added that particular rule/test.
And the output message report of the rule is merely a suggestion indicating
a preference. It's always up to an individual to accept/reject.
At best, perhaps wordsmithing the checkpatch message might be an OK option.
+# ENOTSUPP is not a standard error code and should be avoided in new patches.
+# Folks usually mean EOPNOTSUPP (also called ENOTSUP), when they type ENOTSUPP.
+# Similarly to ENOSYS warning a small number of false positives is expected.
+ if (!$file && $line =~ /\bENOTSUPP\b/) {
+ if (WARN("ENOTSUPP",
+ "ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP\n" . $herecurr) &&
+ $fix) {
+ $fixed[$fixlinenr] =~ s/\bENOTSUPP\b/EOPNOTSUPP/;
+ }
+ }
+
Powered by blists - more mailing lists