From 0bfea95c3c02a887c25260e8aaf31cc9567bc478 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Mon, 15 Dec 2025 14:49:10 +0900 Subject: [PATCH] gpu: nova-core: gsp: use () as message type for GspInitDone message `GspInitDone` has no payload whatsoever, so the unit type `()` is the correct way to represent its message content. We can use it now that `()` implements `FromBytes`. Reviewed-by: Alistair Popple Signed-off-by: Alexandre Courbot Acked-by: Danilo Krummrich Link: https://patch.msgid.link/20251215-transmute_unit-v4-2-477d71ec7c23@nvidia.com Signed-off-by: Miguel Ojeda --- drivers/gpu/nova-core/gsp/commands.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs index 0425c65b5d6fa..2050771f9b53e 100644 --- a/drivers/gpu/nova-core/gsp/commands.rs +++ b/drivers/gpu/nova-core/gsp/commands.rs @@ -142,7 +142,7 @@ impl CommandToGsp for SetRegistry { } /// Message type for GSP initialization done notification. -struct GspInitDone {} +struct GspInitDone; // SAFETY: `GspInitDone` is a zero-sized type with no bytes, therefore it // trivially has no uninitialized bytes. @@ -151,13 +151,13 @@ unsafe impl FromBytes for GspInitDone {} impl MessageFromGsp for GspInitDone { const FUNCTION: MsgFunction = MsgFunction::GspInitDone; type InitError = Infallible; - type Message = GspInitDone; + type Message = (); fn read( _msg: &Self::Message, _sbuffer: &mut SBufferIter>, ) -> Result { - Ok(GspInitDone {}) + Ok(GspInitDone) } } -- 2.47.3