Skip to content

Commit 77b686f

Browse files
committed
gpu: nova-core: make formatting compatible with rust tree
Commit 38b7cc4 ("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 <acourbot@nvidia.com> Tested-by: Alexandre Courbot <acourbot@nvidia.com> Link: https://patch.msgid.link/20251117-nova-fmt-rust-v1-1-651ca28cd98f@google.com Signed-off-by: Alice Ryhl <aliceryhl@google.com>
1 parent ce89e3e commit 77b686f

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

drivers/gpu/nova-core/gpu.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,12 @@ impl TryFrom<regs::NV_PMC_BOOT_42> for Spec {
227227

228228
impl fmt::Display for Spec {
229229
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
230-
write!(
231-
f,
230+
f.write_fmt(fmt!(
232231
"Chipset: {}, Architecture: {:?}, Revision: {}",
233232
self.chipset,
234233
self.chipset.arch(),
235234
self.revision
236-
)
235+
))
237236
}
238237
}
239238

drivers/gpu/nova-core/gsp/fw.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ mod r570_144;
66
// Alias to avoid repeating the version number with every use.
77
use r570_144 as bindings;
88

9-
use core::{
10-
fmt,
11-
ops::Range, //
12-
};
9+
use core::ops::Range;
1310

1411
use kernel::{
1512
dma::CoherentAllocation,
13+
fmt,
1614
prelude::*,
1715
ptr::{
1816
Alignable,

0 commit comments

Comments
 (0)