]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: seq_file: replace `kernel::c_str!` with C-Strings
authorTamir Duberstein <tamird@gmail.com>
Mon, 22 Dec 2025 12:18:57 +0000 (13:18 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 29 Jan 2026 14:32:40 +0000 (15:32 +0100)
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>
rust/kernel/seq_file.rs

index 855e533813a63232b2cc2fe715308d49172fa38c..518265558d66f63098b77728baef9bf6b7252665 100644 (file)
@@ -4,7 +4,7 @@
 //!
 //! C header: [`include/linux/seq_file.h`](srctree/include/linux/seq_file.h)
 
-use crate::{bindings, c_str, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
+use crate::{bindings, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
 
 /// A utility for generating the contents of a seq file.
 #[repr(transparent)]
@@ -36,7 +36,7 @@ impl SeqFile {
         unsafe {
             bindings::seq_printf(
                 self.inner.get(),
-                c_str!("%pA").as_char_ptr(),
+                c"%pA".as_char_ptr(),
                 core::ptr::from_ref(&args).cast::<crate::ffi::c_void>(),
             );
         }