summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPetr Vorel <pvorel@suse.cz>2026-09-04 13:02:27 +0200
committerAndrew Morton <akpm@linux-foundation.org>2026-10-06 19:03:04 -0700
commit40abed2a01a2e501dc7f18bd41693f740b237b9b (patch)
tree8d2195547e9f9341597d8641d2a9489e512ca701 /scripts
parent9e35bebc8b25fee008b4e7d4bb1a07dcfd4c1743 (diff)
downloadlinux-next-40abed2a01a2e501dc7f18bd41693f740b237b9b.tar.gz
linux-next-40abed2a01a2e501dc7f18bd41693f740b237b9b.zip
checkpatch: add more userspace directories to is_userspace()
Patch series "checkpatch: userspace improvements", v6. Few improvements for user space code + --userspace option for projects which vendored checkpatch.pl. There could be probably more checks which are kernel space only. This patch (of 4): arch/ directory contains subdirectories with userspace tools (at least arch/*/tools/ and arch/*/boot/tools/). Add check to consider any arch/.*/tools/ subdirectory as userspace tools directory. This helps not only to strscpy() checks but also to CamelCase checks in the next commit to be more precise. This is a follow-up to 99b70ece33d8 ("checkpatch: suppress strscpy warnings for userspace tools"). Link: https://lore.kernel.org/20260904110230.1219037-1-pvorel@suse.cz Link: https://lore.kernel.org/20260904110230.1219037-2-pvorel@suse.cz Signed-off-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Dwaipayan Ray <dwaipayanray1@gmail.com> Cc: Joe Perches <joe@perches.com> Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f424dafce5bc..b8702f6bc9b5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2667,7 +2667,9 @@ sub exclude_global_initialisers {
sub is_userspace {
my ($realfile) = @_;
- return ($realfile =~ m@^tools/@ || $realfile =~ m@^scripts/@);
+ return ($realfile =~ m@^tools/@ ||
+ $realfile =~ m@^scripts/@ ||
+ $realfile =~ m@^arch/.*/tools/@);
}
sub process {