* + checkpatch-dont-warn-about-enosys-in-userspace-code.patch added to mm-nonmm-unstable branch
@ 2026-11-02 4:37 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-11-02 4:37 UTC (permalink / raw)
To: mm-commits, shuah, lukas.bulwahn, joe, dwaipayanray1, apw,
kolyshkin, akpm
The patch titled
Subject: checkpatch: don't warn about ENOSYS in userspace code
has been added to the -mm mm-nonmm-unstable branch. Its filename is
checkpatch-dont-warn-about-enosys-in-userspace-code.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/checkpatch-dont-warn-about-enosys-in-userspace-code.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Kir Kolyshkin <kolyshkin@gmail.com>
Subject: checkpatch: don't warn about ENOSYS in userspace code
Date: Thu, 22 Oct 2026 15:44:21 -0700
The ENOSYS check enforces a kernel ABI rule: the kernel must only return
-ENOSYS for an invalid syscall number. It makes no sense for userspace
code under tools/, where ENOSYS is a regular "Function not implemented"
error, and checking for errno == ENOSYS is the standard way to detect
that a syscall is not available (e.g. to skip a selftest on an older
kernel). There, the warning is always a false positive.
Use the existing is_userspace() helper to skip the check for such files.
Link: https://lore.kernel.org/20261022224426.2756960-3-kolyshkin@gmail.com
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/scripts/checkpatch.pl~checkpatch-dont-warn-about-enosys-in-userspace-code
+++ a/scripts/checkpatch.pl
@@ -4983,7 +4983,7 @@ sub process {
# ENOSYS means "bad syscall nr" and nothing else. This will have a small
# number of false positives, but assembly files are not checked, so at
# least the arch entry code will not trigger this warning.
- if ($line =~ /\bENOSYS\b/) {
+ if ($line =~ /\bENOSYS\b/ && !is_userspace($realfile)) {
WARN("ENOSYS",
"ENOSYS means 'invalid syscall nr' and nothing else\n" . $herecurr);
}
_
Patches currently in -mm which might be from kolyshkin@gmail.com are
checkpatch-is_userspace-exclude-kernel-code-under-tools.patch
checkpatch-dont-warn-about-enosys-in-userspace-code.patch
checkpatch-dont-warn-about-bug-in-userspace-code.patch
checkpatch-dont-suggest-kstrtotype-in-userspace-code.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-02 4:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 4:37 + checkpatch-dont-warn-about-enosys-in-userspace-code.patch added to mm-nonmm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.