Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: seq_file: 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/20251222-cstr-vfs-v1-1-18e3d327cbd7@gmail.com
Acked-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Tamir Duberstein and committed by
Christian Brauner
40210c2b fd5d8b65

+2 -2
+2 -2
rust/kernel/seq_file.rs
··· 4 4 //! 5 5 //! C header: [`include/linux/seq_file.h`](srctree/include/linux/seq_file.h) 6 6 7 - use crate::{bindings, c_str, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque}; 7 + use crate::{bindings, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque}; 8 8 9 9 /// A utility for generating the contents of a seq file. 10 10 #[repr(transparent)] ··· 36 36 unsafe { 37 37 bindings::seq_printf( 38 38 self.inner.get(), 39 - c_str!("%pA").as_char_ptr(), 39 + c"%pA".as_char_ptr(), 40 40 core::ptr::from_ref(&args).cast::<crate::ffi::c_void>(), 41 41 ); 42 42 }