From: "Benno Lossin" <lossin@kernel.org>
To: "Tamir Duberstein" <tamird@gmail.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Viresh Kumar" <viresh.kumar@linaro.org>,
"Danilo Krummrich" <dakr@kernel.org>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>, "Nishanth Menon" <nm@ti.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>
Cc: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<nouveau@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>,
<rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH 1/6] rust: kernel: remove `fmt!`, fix clippy::uninlined-format-args
Date: Fri, 04 Jul 2025 22:56:26 +0200 [thread overview]
Message-ID: <DB3KKAZ4HJ96.YPY4C6W0Y5HZ@kernel.org> (raw)
In-Reply-To: <20250704-core-cstr-prepare-v1-1-a91524037783@gmail.com>
On Fri Jul 4, 2025 at 10:14 PM CEST, Tamir Duberstein wrote:
> Rather than export a macro that delegates to `core::format_args`, simply
> re-export `core::format_args` as `fmt` from the prelude. This exposes
> clippy warnings which were previously obscured by this macro, such as:
>
> warning: variables can be used directly in the `format!` string
> --> ../drivers/cpufreq/rcpufreq_dt.rs:21:43
> |
> 21 | let prop_name = CString::try_from_fmt(fmt!("{}-supply", name)).ok()?;
> | ^^^^^^^^^^^^^^^^^^^^^^^
> |
> = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
> = note: `-W clippy::uninlined-format-args` implied by `-W clippy::all`
> = help: to override `-W clippy::all` add `#[allow(clippy::uninlined_format_args)]`
> help: change this to
> |
> 21 - let prop_name = CString::try_from_fmt(fmt!("{}-supply", name)).ok()?;
> 21 + let prop_name = CString::try_from_fmt(fmt!("{name}-supply")).ok()?;
> |
>
> Thus fix them in the same commit. This could possibly be fixed in two
> stages, but the diff is small enough (outside of kernel/str.rs) that I
> hope it can taken in a single commit.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
---
Cheers,
Benno
> ---
> drivers/cpufreq/rcpufreq_dt.rs | 3 +--
> drivers/gpu/nova-core/firmware.rs | 5 +++--
> rust/kernel/opp.rs | 2 +-
> rust/kernel/prelude.rs | 2 +-
> rust/kernel/str.rs | 34 ++++++++++++++--------------------
> 5 files changed, 20 insertions(+), 26 deletions(-)
next prev parent reply other threads:[~2025-07-04 20:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 20:14 [PATCH 0/6] Replace `kernel::str::CStr` with `core::ffi::CStr` (cycle 1) Tamir Duberstein
2025-07-04 20:14 ` [PATCH 1/6] rust: kernel: remove `fmt!`, fix clippy::uninlined-format-args Tamir Duberstein
2025-07-04 20:56 ` Benno Lossin [this message]
2025-07-20 21:24 ` Miguel Ojeda
2025-07-20 22:37 ` Danilo Krummrich
2025-07-20 23:03 ` Tamir Duberstein
2025-07-20 23:17 ` Miguel Ojeda
2025-07-20 23:18 ` Tamir Duberstein
2025-07-21 7:37 ` Viresh Kumar
2025-07-21 12:54 ` Miguel Ojeda
2025-07-04 20:14 ` [PATCH 2/6] rust: kernel: add `fmt` module Tamir Duberstein
2025-07-04 22:38 ` Benno Lossin
2025-07-04 20:14 ` [PATCH 3/6] rust: use `kernel::{fmt,prelude::fmt!}` Tamir Duberstein
2025-07-05 9:23 ` Benno Lossin
2025-07-04 20:14 ` [PATCH 4/6] rust: str: remove unnecessary qualification Tamir Duberstein
2025-07-05 8:04 ` Benno Lossin
2025-07-05 8:35 ` Alice Ryhl
2025-07-04 20:14 ` [PATCH 5/6] rust: add `CStr` methods matching `core::ffi::CStr` Tamir Duberstein
2025-07-05 9:15 ` Benno Lossin
2025-07-04 20:14 ` [PATCH 6/6] rust: use `core::ffi::CStr` method names Tamir Duberstein
2025-07-05 9:16 ` Benno Lossin
2025-07-10 13:20 ` [PATCH 0/6] Replace `kernel::str::CStr` with `core::ffi::CStr` (cycle 1) Alice Ryhl
2025-07-20 22:57 ` Miguel Ojeda
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=DB3KKAZ4HJ96.YPY4C6W0Y5HZ@kernel.org \
--to=lossin@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=airlied@gmail.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=nm@ti.com \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=simona@ffwll.ch \
--cc=tamird@gmail.com \
--cc=tmgross@umich.edu \
--cc=viresh.kumar@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®