From: Tamir Duberstein Date: Fri, 23 Jan 2026 05:46:24 +0000 (-0800) Subject: rust: sync: Replace `kernel::c_str!` with C-Strings X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6de07249ef381b674f0d65adf9defcdab76b768;p=thirdparty%2Fkernel%2Flinux.git 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 --- 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) /// }