From: Alice Ryhl Date: Mon, 17 Nov 2025 10:39:17 +0000 (+0000) Subject: gpu: nova-core: make formatting compatible with rust tree X-Git-Tag: v6.19-rc1~157^2~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77b686f688126a5f758b51441a03186e9eb1b0f1;p=thirdparty%2Fkernel%2Flinux.git gpu: nova-core: make formatting compatible with rust tree Commit 38b7cc448a5b ("gpu: nova-core: implement Display for Spec") in drm-rust-next introduced some usage of the Display trait, but the Display trait is being modified in the rust tree this cycle. Thus, to avoid conflicts with the Rust tree, tweak how the formatting machinery is used in a way where it works both with and without the changes in the Rust tree. Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Link: https://patch.msgid.link/20251117-nova-fmt-rust-v1-1-651ca28cd98f@google.com Signed-off-by: Alice Ryhl --- diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs index 19755af6ad045..629c9d2dc994c 100644 --- a/drivers/gpu/nova-core/gpu.rs +++ b/drivers/gpu/nova-core/gpu.rs @@ -227,13 +227,12 @@ impl TryFrom for Spec { impl fmt::Display for Spec { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!( - f, + f.write_fmt(fmt!( "Chipset: {}, Architecture: {:?}, Revision: {}", self.chipset, self.chipset.arch(), self.revision - ) + )) } } diff --git a/drivers/gpu/nova-core/gsp/fw.rs b/drivers/gpu/nova-core/gsp/fw.rs index 8deec5e0a1d4a..abffd6beec654 100644 --- a/drivers/gpu/nova-core/gsp/fw.rs +++ b/drivers/gpu/nova-core/gsp/fw.rs @@ -6,13 +6,11 @@ mod r570_144; // Alias to avoid repeating the version number with every use. use r570_144 as bindings; -use core::{ - fmt, - ops::Range, // -}; +use core::ops::Range; use kernel::{ dma::CoherentAllocation, + fmt, prelude::*, ptr::{ Alignable,