archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <>
To: Joe Perches <>,
Cc:, Jakub Kicinski <>,
	Andrew Lunn <>
Subject: [PATCH net-next] checkpatch: warn about uses of ENOTSUPP
Date: Sun, 10 May 2020 11:51:48 -0700	[thread overview]
Message-ID: <> (raw)

ENOTSUPP often feels like the right error code to use, but it's
in fact not a standard Unix error. E.g.:

$ python
>>> import errno
>>> errno.errorcode[errno.ENOTSUPP]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'errno' has no attribute 'ENOTSUPP'

There were numerous commits converting the uses back to EOPNOTSUPP
but in some cases we are stuck with the high error code for backward
compatibility reasons.

Let's try prevent more ENOTSUPPs from getting into the kernel.

Suggested-by: Andrew Lunn <>
Signed-off-by: Jakub Kicinski <>
Hi Joe, I feel like I already talked to you about this, but I lost
my email archive, so appologies if you already said no.

 scripts/ | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/ b/scripts/
index eac40f0abd56..254877620bd8 100755
--- a/scripts/
+++ b/scripts/
@@ -4199,6 +4199,14 @@ sub process {
 			     "ENOSYS means 'invalid syscall nr' and nothing else\n" . $herecurr);
+# ENOTSUPP is not a standard error code and should be avoided.
+# Folks usually mean EOPNOTSUPP (also called ENOTSUP), when they type ENOTSUPP.
+# Similarly to ENOSYS warning a small number of false positives is expected.
+		if ($line =~ /\bENOTSUPP\b/) {
+			     "ENOTSUPP is not a standard error code, prefer EOPNOTSUPP.\n" . $herecurr);
+		}
 # function brace can't be on same line, except for #defines of do while,
 # or if closed on same line
 		if ($perl_version_ok &&

             reply	other threads:[~2020-05-10 18:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-10 18:51 Jakub Kicinski [this message]
2020-05-10 19:04 ` Andrew Lunn
2020-05-10 19:22   ` Jakub Kicinski
2020-05-10 19:56 ` Joe Perches
2020-05-11 16:48   ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH net-next] checkpatch: warn about uses of ENOTSUPP' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).