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 <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Signed-off-by: Tamir Duberstein <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 26866b6 commit 494de8f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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)