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.

gpu: nova-core: 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>
Acked-by: Danilo Krummrich <dakr@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
4b4d06a7 bf87a41b

+4 -5
+1 -2
drivers/gpu/nova-core/gpu.rs
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 3 - use kernel::{device, devres::Devres, error::code::*, pci, prelude::*, sync::Arc}; 3 + use kernel::{device, devres::Devres, error::code::*, fmt, pci, prelude::*, sync::Arc}; 4 4 5 5 use crate::driver::Bar0; 6 6 use crate::falcon::{gsp::Gsp, sec2::Sec2, Falcon}; ··· 12 12 use crate::regs; 13 13 use crate::util; 14 14 use crate::vbios::Vbios; 15 - use core::fmt; 16 15 17 16 macro_rules! define_chipset { 18 17 ({ $($variant:ident = $value:expr),* $(,)* }) =>
+3 -3
drivers/gpu/nova-core/regs/macros.rs
··· 149 149 150 150 // TODO[REGA]: display the raw hex value, then the value of all the fields. This requires 151 151 // matching the fields, which will complexify the syntax considerably... 152 - impl ::core::fmt::Debug for $name { 153 - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { 152 + impl ::kernel::fmt::Debug for $name { 153 + fn fmt(&self, f: &mut ::kernel::fmt::Formatter<'_>) -> ::kernel::fmt::Result { 154 154 f.debug_tuple(stringify!($name)) 155 - .field(&format_args!("0x{0:x}", &self.0)) 155 + .field(&::kernel::prelude::fmt!("0x{0:x}", &self.0)) 156 156 .finish() 157 157 } 158 158 }