[PATCH v3 1/3] checkpatch: Add more user space directories to is_userspace()
From: Petr Vorel
Date: Wed May 20 2026 - 06:13:55 EST
arch/*/tools/ and arch/*/boot/tools/ are directories containing user
space tools. This helps not only to strscpy checks but also to CamelCase
checks in the next commit to be more precise.
Follow-up: 99b70ece33d8 ("checkpatch: suppress strscpy warnings for userspace tools")
Signed-off-by: Petr Vorel <pvorel@xxxxxxx>
---
New in v3.
scripts/checkpatch.pl | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 939d2b9ecebd..663064f32dae 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2669,7 +2669,10 @@ 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/@ ||
+ $realfile =~ m@^arch/[^/]+/boot/tools/@);
}
sub process {
--
2.54.0