All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: linux-kernel@vger.kernel.org
Cc: Joe Perches <joe@perches.com>, Simon Glass <sjg@chromium.org>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>
Subject: Re: [PATCH v3 3/3] checkpatch: Add new option to force userspace
Date: Wed, 20 May 2026 22:37:14 +0200	[thread overview]
Message-ID: <20260520203714.GB94543@pevik> (raw)
In-Reply-To: <20260520100829.93791-4-pvorel@suse.cz>

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> New in v3.

>  scripts/checkpatch.pl | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 60da43b00d55..205ce64d06bf 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -63,6 +63,7 @@ my $env_config_dir = 'CHECKPATCH_CONFIG_DIR';
>  my $max_line_length = 100;
>  my $ignore_perl_version = 0;
>  my $spdx_cxx_comments = 0;
> +my $userspace = 0;
>  my $minimum_perl_version = 5.10.0;
>  my $min_conf_desc_length = 4;
>  my $spelling_file = "$D/spelling.txt";
> @@ -143,6 +144,7 @@ Options:
>                               (required by old toolchains), allow also C++
>                               comments (//).
>                               NOTE: it should *not* be used for Linux mainline.
> +  --userspace                Force rules specific for userspace.
>    --codespell                Use the codespell dictionary for spelling/typos
>                               (default:$codespellfile)
>    --codespellfile            Use this codespell dictionary
> @@ -358,6 +360,7 @@ GetOptions(
>  	'codespell!'	=> \$codespell,
>  	'codespellfile=s'	=> \$user_codespellfile,
>  	'typedefsfile=s'	=> \$typedefsfile,
> +	'userspace'	=> \$userspace,

sashiko suggest to use "!" to allow --no-userspace. I don't see a point in
having it because it's off by default, but as most of options without parameters
use it, I can add it for consistency.

Kind regards,
Petr

>  	'color=s'	=> \$color,
>  	'no-color'	=> \$color,	#keep old behaviors of -nocolor
>  	'nocolor'	=> \$color,	#keep old behaviors of -nocolor
> @@ -2669,7 +2672,8 @@ sub exclude_global_initialisers {

>  sub is_userspace {
>      my ($realfile) = @_;
> -    return ($realfile =~ m@^tools/@ ||
> +    return ($userspace ||
> +		$realfile =~ m@^tools/@ ||
>  		$realfile =~ m@^scripts/@ ||
>  		$realfile =~ m@^arch/[^/]+/tools/@ ||
>  		$realfile =~ m@^arch/[^/]+/boot/tools/@);

      reply	other threads:[~2026-05-20 20:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 10:08 [PATCH v3 0/3] checkpatch: userspace improvements Petr Vorel
2026-05-20 10:08 ` [PATCH v3 1/3] checkpatch: Add more user space directories to is_userspace() Petr Vorel
2026-05-20 15:13   ` Joe Perches
2026-05-20 20:35     ` Petr Vorel
2026-05-20 10:08 ` [PATCH v3 2/3] checkpatch: Ignore <inttypes.h> format macros for userspace tools Petr Vorel
2026-05-20 10:08 ` [PATCH v3 3/3] checkpatch: Add new option to force userspace Petr Vorel
2026-05-20 20:37   ` Petr Vorel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260520203714.GB94543@pevik \
    --to=pvorel@suse.cz \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=sjg@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.