The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
@ 2025-12-22 12:18 Tamir Duberstein
  2025-12-22 14:31 ` Daniel Almeida
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tamir Duberstein @ 2025-12-22 12:18 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich
  Cc: linux-fsdevel, rust-for-linux, linux-kernel, Tamir Duberstein,
	Greg Kroah-Hartman

From: Tamir Duberstein <tamird@gmail.com>

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>
---
 rust/kernel/seq_file.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rust/kernel/seq_file.rs b/rust/kernel/seq_file.rs
index 855e533813a6..518265558d66 100644
--- a/rust/kernel/seq_file.rs
+++ b/rust/kernel/seq_file.rs
@@ -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 @@ pub fn call_printf(&self, args: fmt::Arguments<'_>) {
         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>(),
             );
         }

---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cstr-vfs-55ca2ceca0a4

Best regards,
--  
Tamir Duberstein <tamird@gmail.com>


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-01-30 18:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 12:18 [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings Tamir Duberstein
2025-12-22 14:31 ` Daniel Almeida
2026-01-04  2:29 ` Tamir Duberstein
2026-01-19 12:52   ` Tamir Duberstein
2026-01-19 17:59     ` Miguel Ojeda
2026-01-27 14:13       ` Tamir Duberstein
2026-01-29 14:32 ` Christian Brauner
2026-01-29 15:14   ` Tamir Duberstein
2026-01-29 15:20     ` Miguel Ojeda
2026-01-30 18:21       ` Tamir Duberstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox