* Re: [PATCH v3 9/9] rust: device: use `kernel::{fmt,prelude::fmt!}`
[not found] ` <20250813-core-cstr-fanout-1-v3-9-a15eca059c51@gmail.com>
@ 2025-08-14 7:54 ` Benno Lossin
0 siblings, 0 replies; only message in thread
From: Benno Lossin @ 2025-08-14 7:54 UTC (permalink / raw)
To: Tamir Duberstein, Danilo Krummrich, David Airlie, Simona Vetter,
Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Jens Axboe, Greg Kroah-Hartman, Rafael J. Wysocki,
Brendan Higgins, David Gow, Rae Moar, Lorenzo Stoakes,
Vlastimil Babka, Liam R. Howlett, Uladzislau Rezki,
Alexandre Courbot, Alexander Viro, Christian Brauner, Jan Kara
Cc: nouveau, dri-devel, linux-kernel, rust-for-linux, linux-block,
linux-kselftest, kunit-dev, linux-fsdevel
On Wed Aug 13, 2025 at 5:39 PM CEST, Tamir Duberstein wrote:
> Reduce coupling to implementation details of the formatting machinery by
> avoiding direct use for `core`'s formatting traits and macros.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
> ---
> rust/kernel/device/property.rs | 23 ++++++++++++-----------
> 1 file changed, 12 insertions(+), 11 deletions(-)
> @@ -413,9 +414,9 @@ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
> // SAFETY: `fwnode_get_name_prefix` returns null or a
> // valid C string.
> let prefix = unsafe { CStr::from_char_ptr(prefix) };
> - write!(f, "{prefix}")?;
> + fmt::Display::fmt(prefix, f)?;
> }
> - write!(f, "{}", fwnode.display_name())?;
So we're not able to use `write!` with our `Display` or did you also
write a `FmtAdapter` wrapper for that? (don't think we need it now, just
wanted to know if we have this issue possibly in the future)
---
Cheers,
Benno
> + fmt::Display::fmt(&fwnode.display_name(), f)?;
> }
>
> Ok(())
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-14 7:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250813-core-cstr-fanout-1-v3-0-a15eca059c51@gmail.com>
[not found] ` <20250813-core-cstr-fanout-1-v3-9-a15eca059c51@gmail.com>
2025-08-14 7:54 ` [PATCH v3 9/9] rust: device: use `kernel::{fmt,prelude::fmt!}` Benno Lossin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).