]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: warn about uses of ENOTSUPP
authorJakub Kicinski <kuba@kernel.org>
Mon, 11 May 2020 17:08:07 +0000 (10:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 May 2020 00:00:30 +0000 (17:00 -0700)
commitab29a4c2567db2516adef004a5b1dc96ca60a4a2
tree77cd27b5c903f53758386bfe3141fe54d3424eb7
parentdef8f33ddc5ecca8c095ac8a1449507a33ed63de
checkpatch: warn about uses of ENOTSUPP

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.

Recent example:
https://lore.kernel.org/netdev/20200510182252.GA411829@lunn.ch/

v3 (Joe):
 - fix the "not file" condition.

v2 (Joe):
 - add a link to recent discussion,
 - don't match when scanning files, not patches to avoid sudden
   influx of conversion patches.
https://lore.kernel.org/netdev/20200511165319.2251678-1-kuba@kernel.org/

v1:
https://lore.kernel.org/netdev/20200510185148.2230767-1-kuba@kernel.org/

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
scripts/checkpatch.pl