Skip to content

Commit 494de8f

Browse files
tamirdojeda
authored andcommitted
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 <gregkh@linuxfoundation.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Signed-off-by: Tamir Duberstein <tamird@gmail.com> Link: https://patch.msgid.link/20251117-core-cstr-cstrings-v4-1-924886ad9f75@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 26866b6 commit 494de8f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

rust/kernel/sync.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ impl LockClassKey {
4848
///
4949
/// # Examples
5050
/// ```
51-
/// # use kernel::c_str;
5251
/// # use kernel::alloc::KBox;
5352
/// # use kernel::types::ForeignOwnable;
5453
/// # use kernel::sync::{LockClassKey, SpinLock};
@@ -60,7 +59,7 @@ impl LockClassKey {
6059
/// {
6160
/// stack_pin_init!(let num: SpinLock<u32> = SpinLock::new(
6261
/// 0,
63-
/// c_str!("my_spinlock"),
62+
/// c"my_spinlock",
6463
/// // SAFETY: `key_ptr` is returned by the above `into_foreign()`, whose
6564
/// // `from_foreign()` has not yet been called.
6665
/// unsafe { <Pin<KBox<LockClassKey>> as ForeignOwnable>::borrow(key_ptr) }

0 commit comments

Comments
 (0)