On Sun Sep 27, 2026 at 10:46 PM JST, Alexandre Courbot wrote:
> `send_single_command` handles both the transport and message layers of
> the command, intertwining the logic of the two.
>
> Reorder the code so the message layer logic is within the same
> contiguous block of code, so it can easily be moved.
>
> No functional change intended.
>
> Signed-off-by: Alexandre Courbot <[email protected]>
> ---
>  drivers/gpu/nova-core/gsp/cmdq.rs | 31 +++++++++++++++++--------------
>  1 file changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs 
> b/drivers/gpu/nova-core/gsp/cmdq.rs
> index 3a8548a51259..07e8e32c3d57 100644
> --- a/drivers/gpu/nova-core/gsp/cmdq.rs
> +++ b/drivers/gpu/nova-core/gsp/cmdq.rs
> @@ -659,18 +659,21 @@ fn send_single_command<M>(&mut self, command: M) -> 
> Result
>              .gsp_mem
>              .allocate_command(size_in_bytes, Self::ALLOCATE_TIMEOUT)?;
>  
> +        // Fill the header.
> +        let msg_element_init = GspMsgElement::init(self.seq, size_in_bytes);
> +        // SAFETY: `msg_header` is a valid reference, and not touched if the 
> initializer fails.

nit: `msg_header` not used here

> +        unsafe {
> +            pin_init::raw_try_init(core::ptr::from_mut(dst.header), 
> msg_element_init)?;
> +        }
> +

Reviewed-by: Eliot Courtney <[email protected]>

Reply via email to