linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Matti Vaittinen <mazziesaccount@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"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 08:08:52 -0700	[thread overview]
Message-ID: <1ceb7dc5c2fa376470ab9274020fddf1c2f1584f.camel@perches.com> (raw)
In-Reply-To: <CAHp75VdXa2bkJ+ej+HNYstLeK4TF+L5H3wTgm0CgJ9hYQeU+ZQ@mail.gmail.com>

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 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/;
+                       }
+               }
+



  parent reply	other threads:[~2021-03-29 15:09 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
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 [this message]
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=1ceb7dc5c2fa376470ab9274020fddf1c2f1584f.camel@perches.com \
    --to=joe@perches.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.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;
as well as URLs for NNTP newsgroup(s).