From: Joe Perches <joe@perches.com>
To: Jakub Kicinski <kuba@kernel.org>,
davem@davemloft.net, Andrew Morton <akpm@linux-foundation.org>
Cc: netdev@vger.kernel.org, andrew@lunn.ch, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2] checkpatch: warn about uses of ENOTSUPP
Date: Mon, 11 May 2020 10:03:31 -0700 [thread overview]
Message-ID: <c4b600b5455fcb48975cfc9d8214cdbbc01f2e2f.camel@perches.com> (raw)
In-Reply-To: <20200511165319.2251678-1-kuba@kernel.org>
On Mon, 2020-05-11 at 09:53 -0700, Jakub Kicinski wrote:
> ENOTSUPP often feels like the right error code to use, but it's
> in fact not a standard Unix error. E.g.:
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -4199,6 +4199,17 @@ sub process {
> "ENOSYS means 'invalid syscall nr' and nothing else\n" . $herecurr);
> }
>
> +# 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/) {
It's probably my typo or my brain thinking "not" and hitting
the tilde and not the bang, but this should be
if (!$file & ...)
Otherwise:
Acked-by: Joe Perches <joe@perches.com>
> + if (WARN("ENOTSUPP",
> + "ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP\n" . $herecurr) &&
> + $fix) {
> + $fixed[$fixlinenr] =~ s/\bENOTSUPP\b/EOPNOTSUPP/;
> + }
> + }
> +
> # function brace can't be on same line, except for #defines of do while,
> # or if closed on same line
> if ($perl_version_ok &&
next prev parent reply other threads:[~2020-05-11 17:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 16:53 [PATCH net-next v2] checkpatch: warn about uses of ENOTSUPP Jakub Kicinski
2020-05-11 17:03 ` Joe Perches [this message]
2020-05-11 17:07 ` 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=c4b600b5455fcb48975cfc9d8214cdbbc01f2e2f.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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