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: gsp: remove unnecessary Display impls

We only ever display these in debug context, for which the automatically
derived `Debug` impls work just fine - so use them and remove these
boilerplate-looking implementations.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260217-nova-misc-v3-2-b4e2d45eafbc@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>

+1 -55
+1 -1
drivers/gpu/nova-core/gsp/cmdq.rs
··· 544 544 545 545 dev_dbg!( 546 546 &self.dev, 547 - "GSP RPC: send: seq# {}, function={}, length=0x{:x}\n", 547 + "GSP RPC: send: seq# {}, function={:?}, length=0x{:x}\n", 548 548 self.seq, 549 549 M::FUNCTION, 550 550 dst.header.length(),
-54
drivers/gpu/nova-core/gsp/fw.rs
··· 10 10 11 11 use kernel::{ 12 12 dma::CoherentAllocation, 13 - fmt, 14 13 prelude::*, 15 14 ptr::{ 16 15 Alignable, ··· 222 223 UcodeLibOsPrint = bindings::NV_VGPU_MSG_EVENT_UCODE_LIBOS_PRINT, 223 224 } 224 225 225 - impl fmt::Display for MsgFunction { 226 - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 227 - match self { 228 - // Common function codes 229 - MsgFunction::Nop => write!(f, "NOP"), 230 - MsgFunction::SetGuestSystemInfo => write!(f, "SET_GUEST_SYSTEM_INFO"), 231 - MsgFunction::AllocRoot => write!(f, "ALLOC_ROOT"), 232 - MsgFunction::AllocDevice => write!(f, "ALLOC_DEVICE"), 233 - MsgFunction::AllocMemory => write!(f, "ALLOC_MEMORY"), 234 - MsgFunction::AllocCtxDma => write!(f, "ALLOC_CTX_DMA"), 235 - MsgFunction::AllocChannelDma => write!(f, "ALLOC_CHANNEL_DMA"), 236 - MsgFunction::MapMemory => write!(f, "MAP_MEMORY"), 237 - MsgFunction::BindCtxDma => write!(f, "BIND_CTX_DMA"), 238 - MsgFunction::AllocObject => write!(f, "ALLOC_OBJECT"), 239 - MsgFunction::Free => write!(f, "FREE"), 240 - MsgFunction::Log => write!(f, "LOG"), 241 - MsgFunction::GetGspStaticInfo => write!(f, "GET_GSP_STATIC_INFO"), 242 - MsgFunction::SetRegistry => write!(f, "SET_REGISTRY"), 243 - MsgFunction::GspSetSystemInfo => write!(f, "GSP_SET_SYSTEM_INFO"), 244 - MsgFunction::GspInitPostObjGpu => write!(f, "GSP_INIT_POST_OBJGPU"), 245 - MsgFunction::GspRmControl => write!(f, "GSP_RM_CONTROL"), 246 - MsgFunction::GetStaticInfo => write!(f, "GET_STATIC_INFO"), 247 - 248 - // Event codes 249 - MsgFunction::GspInitDone => write!(f, "INIT_DONE"), 250 - MsgFunction::GspRunCpuSequencer => write!(f, "RUN_CPU_SEQUENCER"), 251 - MsgFunction::PostEvent => write!(f, "POST_EVENT"), 252 - MsgFunction::RcTriggered => write!(f, "RC_TRIGGERED"), 253 - MsgFunction::MmuFaultQueued => write!(f, "MMU_FAULT_QUEUED"), 254 - MsgFunction::OsErrorLog => write!(f, "OS_ERROR_LOG"), 255 - MsgFunction::GspPostNoCat => write!(f, "NOCAT"), 256 - MsgFunction::GspLockdownNotice => write!(f, "LOCKDOWN_NOTICE"), 257 - MsgFunction::UcodeLibOsPrint => write!(f, "LIBOS_PRINT"), 258 - } 259 - } 260 - } 261 - 262 226 impl TryFrom<u32> for MsgFunction { 263 227 type Error = kernel::error::Error; 264 228 ··· 290 328 RegPoll = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_POLL, 291 329 RegStore = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_STORE, 292 330 RegWrite = bindings::GSP_SEQ_BUF_OPCODE_GSP_SEQ_BUF_OPCODE_REG_WRITE, 293 - } 294 - 295 - impl fmt::Display for SeqBufOpcode { 296 - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 297 - match self { 298 - SeqBufOpcode::CoreReset => write!(f, "CORE_RESET"), 299 - SeqBufOpcode::CoreResume => write!(f, "CORE_RESUME"), 300 - SeqBufOpcode::CoreStart => write!(f, "CORE_START"), 301 - SeqBufOpcode::CoreWaitForHalt => write!(f, "CORE_WAIT_FOR_HALT"), 302 - SeqBufOpcode::DelayUs => write!(f, "DELAY_US"), 303 - SeqBufOpcode::RegModify => write!(f, "REG_MODIFY"), 304 - SeqBufOpcode::RegPoll => write!(f, "REG_POLL"), 305 - SeqBufOpcode::RegStore => write!(f, "REG_STORE"), 306 - SeqBufOpcode::RegWrite => write!(f, "REG_WRITE"), 307 - } 308 - } 309 331 } 310 332 311 333 impl TryFrom<u32> for SeqBufOpcode {