[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXAnTVnprfDnj7se@tardis-2.local>
Date: Wed, 21 Jan 2026 09:09:33 +0800
From: Boqun Feng <boqun.feng@...il.com>
To: Tamir Duberstein <tamird@...nel.org>,
Peter Zijlstra <peterz@...radead.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rust: sync: replace `kernel::c_str!` with C-Strings
[Cc Peter]
Peter, could you take this to into tip/locking/core so that it'll be
in the PR of v7.0?
On Tue, Jan 20, 2026 at 04:13:19PM -0500, Tamir Duberstein wrote:
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
>
> Signed-off-by: Tamir Duberstein <tamird@...nel.org>
Reviewed-by: Boqun Feng <boqun.feng@...il.com>
Regards,
Boqun
> ---
> This is the same as my earlier change[0] but applies to additional
> code[1] which didn't make it to mainline in a timely manner and is now
> queued for v7.0.
>
> Link: https://lore.kernel.org/all/20251117-core-cstr-cstrings-v4-1-924886ad9f75@gmail.com/ [0]
> Link: https://lore.kernel.org/all/20250811-lock-class-key-cleanup-v3-2-b12967ee1ca2@google.com/ [1]
> ---
> rust/kernel/sync.rs | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/rust/kernel/sync.rs b/rust/kernel/sync.rs
> index b10e576221ff..993dbf2caa0e 100644
> --- a/rust/kernel/sync.rs
> +++ b/rust/kernel/sync.rs
> @@ -126,13 +126,12 @@ fn drop(self: Pin<&mut Self>) {
> /// # Examples
> ///
> /// ```
> -/// use kernel::c_str;
> /// use kernel::sync::{static_lock_class, Arc, SpinLock};
> ///
> /// fn new_locked_int() -> Result<Arc<SpinLock<u32>>> {
> /// Arc::pin_init(SpinLock::new(
> /// 42,
> -/// c_str!("new_locked_int"),
> +/// c"new_locked_int",
> /// static_lock_class!(),
> /// ), GFP_KERNEL)
> /// }
>
> ---
> base-commit: d08c85ac8894995d4b0d8fb48d2f6a3e53cd79ab
> change-id: 20260120-cstr-sync-again-5912d7479909
>
> Best regards,
> --
> Tamir Duberstein <tamird@...nel.org>
>
Powered by blists - more mailing lists