[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260120-cstr-sync-again-v1-1-2a775a2a36fd@kernel.org>
Date: Tue, 20 Jan 2026 16:13:19 -0500
From: Tamir Duberstein <tamird@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
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>
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
Tamir Duberstein <tamird@...nel.org>
Subject: [PATCH] rust: sync: replace `kernel::c_str!` with C-Strings
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>
---
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