[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJ-ks9=ux6BuPYmRVSjhfn7kuagxPWicBZbumDFKAqmHKd8+PQ@mail.gmail.com>
Date: Mon, 14 Jul 2025 17:08:42 -0400
From: Tamir Duberstein <tamird@...il.com>
To: Danilo Krummrich <dakr@...nel.org>, David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, Jens Axboe <axboe@...nel.dk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
Brendan Higgins <brendan.higgins@...ux.dev>, David Gow <davidgow@...gle.com>,
Rae Moar <rmoar@...gle.com>
Cc: nouveau@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
linux-block@...r.kernel.org, linux-kselftest@...r.kernel.org,
kunit-dev@...glegroups.com, Christian Brauner <brauner@...nel.org>
Subject: Re: [PATCH 8/9] rust: seq_file: use `kernel::{fmt,prelude::fmt!}`
On Wed, Jul 9, 2025 at 4:00 PM Tamir Duberstein <tamird@...il.com> wrote:
>
> 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@...uxfoundation.org>
> Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
> Signed-off-by: Tamir Duberstein <tamird@...il.com>
Oops, forgot to include Christian Brauner. Christian, could you please
take a look?
MAINTAINERS entry being added in
https://lore.kernel.org/all/20250714124637.1905722-1-aliceryhl@google.com/.
(Thanks Alice!)
> ---
> rust/kernel/seq_file.rs | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/rust/kernel/seq_file.rs b/rust/kernel/seq_file.rs
> index 8f199b1a3bb1..59fbfc2473f8 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, types::NotThreadSafe, types::Opaque};
> +use crate::{bindings, c_str, fmt, types::NotThreadSafe, types::Opaque};
>
> /// A utility for generating the contents of a seq file.
> #[repr(transparent)]
> @@ -31,7 +31,7 @@ pub unsafe fn from_raw<'a>(ptr: *mut bindings::seq_file) -> &'a SeqFile {
>
> /// Used by the [`seq_print`] macro.
> #[inline]
> - pub fn call_printf(&self, args: core::fmt::Arguments<'_>) {
> + pub fn call_printf(&self, args: fmt::Arguments<'_>) {
> // SAFETY: Passing a void pointer to `Arguments` is valid for `%pA`.
> unsafe {
> bindings::seq_printf(
> @@ -47,7 +47,7 @@ pub fn call_printf(&self, args: core::fmt::Arguments<'_>) {
> #[macro_export]
> macro_rules! seq_print {
> ($m:expr, $($arg:tt)+) => (
> - $m.call_printf(format_args!($($arg)+))
> + $m.call_printf($crate::prelude::fmt!($($arg)+))
> );
> }
> pub use seq_print;
>
> --
> 2.50.0
>
Powered by blists - more mailing lists