[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ff72e47bf89977efe00df6db6ebbdd7b22a9972.camel@perches.com>
Date: Sun, 22 May 2022 19:17:29 -0700
From: Joe Perches <joe@...ches.com>
To: Miguel Ojeda <ojeda@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
Jarkko Sakkinen <jarkko@...nel.org>,
Kees Cook <keescook@...omium.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...gle.com>,
Andy Whitcroft <apw@...onical.com>,
Dwaipayan Ray <dwaipayanray1@...il.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: Re: [PATCH v7 15/25] scripts: checkpatch: diagnose uses of `%pA` in
the C side
On Mon, 2022-05-23 at 04:01 +0200, Miguel Ojeda wrote:
> The `%pA` format specifier is only intended to be used from Rust.
>
> `checkpatch.pl` already gives a warning for invalid specificers:
>
> WARNING: Invalid vsprintf pointer extension '%pA'
>
> With this change, we introduce an error message with further
> explanation:
>
> ERROR: '%pA' is only intended to be used from Rust code
>
> Suggested-by: Kees Cook <keescook@...omium.org>
> Co-developed-by: Alex Gaynor <alex.gaynor@...il.com>
> Signed-off-by: Alex Gaynor <alex.gaynor@...il.com>
> Co-developed-by: Wedson Almeida Filho <wedsonaf@...gle.com>
> Signed-off-by: Wedson Almeida Filho <wedsonaf@...gle.com>
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
How many developers are required for a trivial patch?
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -6784,6 +6784,10 @@ sub process {
> my $stat_real = get_stat_real($linenr, $lc);
> my $ext_type = "Invalid";
> my $use = "";
> + if ($bad_specifier =~ /pA/) {
> + ERROR("VSPRINTF_RUST",
> + "'\%pA' is only intended to be used from Rust code\n" . "$here\n$stat_real\n");
> + }
> if ($bad_specifier =~ /p[Ff]/) {
and this should now use elsif
> $use = " - use %pS instead";
> $use =~ s/pS/ps/ if ($bad_specifier =~ /pf/);
Powered by blists - more mailing lists