Re: [PATCH v3 1/3] checkpatch: Add more user space directories to is_userspace()
From: Joe Perches
Date: Wed May 20 2026 - 11:32:00 EST
On Wed, 2026-05-20 at 12:08 +0200, Petr Vorel wrote:
> 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.
[]
> diff --git 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/@);
Perhaps a more generic test like
m@^arch/.*\btools\b@