From e6de07249ef381b674f0d65adf9defcdab76b768 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 22 Jan 2026 21:46:24 -0800 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 Signed-off-by: Boqun Feng Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Gary Guo 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 b10e576221ff6..993dbf2caa0e3 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::pin_init(SpinLock::new( /// 42, -/// c_str!("new_locked_int"), +/// c"new_locked_int", /// static_lock_class!(), /// ), GFP_KERNEL) /// } -- 2.47.3