Skip to content

Commit 0bfea95

Browse files
Gnurouojeda
authored andcommitted
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 <apopple@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20251215-transmute_unit-v4-2-477d71ec7c23@nvidia.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 209c709 commit 0bfea95

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl CommandToGsp for SetRegistry {
142142
}
143143

144144
/// Message type for GSP initialization done notification.
145-
struct GspInitDone {}
145+
struct GspInitDone;
146146

147147
// SAFETY: `GspInitDone` is a zero-sized type with no bytes, therefore it
148148
// trivially has no uninitialized bytes.
@@ -151,13 +151,13 @@ unsafe impl FromBytes for GspInitDone {}
151151
impl MessageFromGsp for GspInitDone {
152152
const FUNCTION: MsgFunction = MsgFunction::GspInitDone;
153153
type InitError = Infallible;
154-
type Message = GspInitDone;
154+
type Message = ();
155155

156156
fn read(
157157
_msg: &Self::Message,
158158
_sbuffer: &mut SBufferIter<array::IntoIter<&[u8], 2>>,
159159
) -> Result<Self, Self::InitError> {
160-
Ok(GspInitDone {})
160+
Ok(GspInitDone)
161161
}
162162
}
163163

0 commit comments

Comments
 (0)