[PATCH v4 0/3] checkpatch: userspace improvements

Petr Vorel posted 3 patches 1 month, 2 weeks ago
There is a newer version of this series
scripts/checkpatch.pl | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
[PATCH v4 0/3] checkpatch: userspace improvements
Posted by Petr Vorel 1 month, 2 weeks ago
Changes v3->v4:
* Change test for directory to be more more generic (Joe)
* Allow to use --no-userspace (sashiko)

Link to v3:
https://lore.kernel.org/lkml/20260520100829.93791-1-pvorel@suse.cz/
https://sashiko.dev/#/patchset/20260520100829.93791-1-pvorel%40suse.cz

Petr Vorel (3):
  checkpatch: Add more userspace directories to is_userspace()
  checkpatch: Ignore <inttypes.h> format macros for userspace tools
  checkpatch: Add new option to force userspace

 scripts/checkpatch.pl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

-- 
2.55.0
Re: [PATCH v4 0/3] checkpatch: userspace improvements
Posted by Andrew Morton 4 weeks ago
On Mon, 10 Aug 2026 18:45:49 +0200 Petr Vorel <pvorel@suse.cz> wrote:

> Changes v3->v4:
> * Change test for directory to be more more generic (Joe)
> * Allow to use --no-userspace (sashiko)

Sashiko had a few more questions?
	https://sashiko.dev/#/patchset/20260810164552.1049483-1-pvorel@suse.cz
Re: [PATCH v4 0/3] checkpatch: userspace improvements
Posted by Petr Vorel 4 weeks ago
Hi Andrew,

> On Mon, 10 Aug 2026 18:45:49 +0200 Petr Vorel <pvorel@suse.cz> wrote:

> > Changes v3->v4:
> > * Change test for directory to be more more generic (Joe)
> > * Allow to use --no-userspace (sashiko)

> Sashiko had a few more questions?
> 	https://sashiko.dev/#/patchset/20260810164552.1049483-1-pvorel@suse.cz

Thanks for a reminder. All are about kernel code being wrongly considered as user space.
At the beginning I was not sure if we need --no-userspace at all, but we
probably do for non-kernel projects which pass --userspace permanently via
configuration file.

1) The original regex was suggested by Joe and should mostly work, but using /
is indeed safer.
-m@^arch/.*\btools\b@
+m@^arch/.*/tools/@

2) my $userspace = 0 will indeed prevent --no-userspace from working as an
override. I did not considered this as important, but let's fix that.

3) return ($userspace || path based detection: dtto

=> v5

Kind regards,
Petr