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: 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>

authored by

Alexandre Courbot and committed by
Miguel Ojeda
0bfea95c 209c7095

+3 -3
+3 -3
drivers/gpu/nova-core/gsp/commands.rs
··· 142 142 } 143 143 144 144 /// Message type for GSP initialization done notification. 145 - struct GspInitDone {} 145 + struct GspInitDone; 146 146 147 147 // SAFETY: `GspInitDone` is a zero-sized type with no bytes, therefore it 148 148 // trivially has no uninitialized bytes. ··· 151 151 impl MessageFromGsp for GspInitDone { 152 152 const FUNCTION: MsgFunction = MsgFunction::GspInitDone; 153 153 type InitError = Infallible; 154 - type Message = GspInitDone; 154 + type Message = (); 155 155 156 156 fn read( 157 157 _msg: &Self::Message, 158 158 _sbuffer: &mut SBufferIter<array::IntoIter<&[u8], 2>>, 159 159 ) -> Result<Self, Self::InitError> { 160 - Ok(GspInitDone {}) 160 + Ok(GspInitDone) 161 161 } 162 162 } 163 163