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: use `kernel::{fmt,prelude::fmt!}`

Reduce coupling to implementation details of the formatting machinery by
avoiding direct use for `core`'s formatting traits and macros.

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>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Tamir Duberstein and committed by
Miguel Ojeda
5990533a aa2417c1

+3 -3
+3 -3
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, types::NotThreadSafe, types::Opaque}; 7 + use crate::{bindings, c_str, fmt, types::NotThreadSafe, types::Opaque}; 8 8 9 9 /// A utility for generating the contents of a seq file. 10 10 #[repr(transparent)] ··· 31 31 32 32 /// Used by the [`seq_print`] macro. 33 33 #[inline] 34 - pub fn call_printf(&self, args: core::fmt::Arguments<'_>) { 34 + pub fn call_printf(&self, args: fmt::Arguments<'_>) { 35 35 // SAFETY: Passing a void pointer to `Arguments` is valid for `%pA`. 36 36 unsafe { 37 37 bindings::seq_printf( ··· 47 47 #[macro_export] 48 48 macro_rules! seq_print { 49 49 ($m:expr, $($arg:tt)+) => ( 50 - $m.call_printf(format_args!($($arg)+)) 50 + $m.call_printf($crate::prelude::fmt!($($arg)+)) 51 51 ); 52 52 } 53 53 pub use seq_print;