]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rust: sync: Replace `kernel::c_str!` with C-Strings
authorTamir Duberstein <tamird@kernel.org>
Fri, 23 Jan 2026 05:46:24 +0000 (21:46 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 28 Jan 2026 08:25:44 +0000 (09:25 +0100)
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

index b10e576221ff6fe941cf03eba4ff072a58774e00..993dbf2caa0e3bde0c4d725bb18bd198f499c4f3 100644 (file)
@@ -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)
 /// }