From: Tamir Duberstein Date: Mon, 17 Nov 2025 16:38:07 +0000 (-0500) Subject: rust: sync: replace `kernel::c_str!` with C-Strings X-Git-Tag: v6.19-rc1~175^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=494de8f67b1e586b0190eb7f835e97c97f6b81b1;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. Acked-by: Greg Kroah-Hartman Reviewed-by: Alice Ryhl Reviewed-by: Benno Lossin Signed-off-by: Tamir Duberstein Link: https://patch.msgid.link/20251117-core-cstr-cstrings-v4-1-924886ad9f75@gmail.com Signed-off-by: Miguel Ojeda --- diff --git a/rust/kernel/sync.rs b/rust/kernel/sync.rs index cf5b638a097d9..c94753d6413e2 100644 --- a/rust/kernel/sync.rs +++ b/rust/kernel/sync.rs @@ -48,7 +48,6 @@ impl LockClassKey { /// /// # Examples /// ``` - /// # use kernel::c_str; /// # use kernel::alloc::KBox; /// # use kernel::types::ForeignOwnable; /// # use kernel::sync::{LockClassKey, SpinLock}; @@ -60,7 +59,7 @@ impl LockClassKey { /// { /// stack_pin_init!(let num: SpinLock = SpinLock::new( /// 0, - /// c_str!("my_spinlock"), + /// c"my_spinlock", /// // SAFETY: `key_ptr` is returned by the above `into_foreign()`, whose /// // `from_foreign()` has not yet been called. /// unsafe { > as ForeignOwnable>::borrow(key_ptr) }