[tip: locking/core] rust: sync: Replace `kernel::c_str!` with C-Strings

tip-bot2 for Tamir Duberstein posted 1 patch 1 week, 2 days ago
rust/kernel/sync.rs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[tip: locking/core] rust: sync: Replace `kernel::c_str!` with C-Strings
Posted by tip-bot2 for Tamir Duberstein 1 week, 2 days ago
The following commit has been merged into the locking/core branch of tip:

Commit-ID:     e6de07249ef381b674f0d65adf9defcdab76b768
Gitweb:        https://git.kernel.org/tip/e6de07249ef381b674f0d65adf9defcdab76b768
Author:        Tamir Duberstein <tamird@kernel.org>
AuthorDate:    Thu, 22 Jan 2026 21:46:24 -08:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 28 Jan 2026 09:25:44 +01:00

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@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260120-cstr-sync-again-v1-1-2a775a2a36fd@kernel.org
Link: https://patch.msgid.link/20260123054624.8226-2-boqun.feng@gmail.com
---
 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 b10e576..993dbf2 100644
--- a/rust/kernel/sync.rs
+++ b/rust/kernel/sync.rs
@@ -126,13 +126,12 @@ impl PinnedDrop for LockClassKey {
 /// # 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)
 /// }