lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <gqe7jfj3bwvar5kk6dqc2dsxwrrs7ug3tpyj6b3sktkzi7bjlg@a6aukp6v6com>
Date: Mon, 8 Dec 2025 21:56:17 +1100
From: Alistair Popple <apopple@...dia.com>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>, 
	Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>, 
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, 
	Danilo Krummrich <dakr@...nel.org>, John Hubbard <jhubbard@...dia.com>, 
	Joel Fernandes <joelagnelf@...dia.com>, Timur Tabi <ttabi@...dia.com>, Edwin Peer <epeer@...dia.com>, 
	rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] gpu: nova-core: gsp: use () as message type for
 GspInitDone message

On 2025-12-08 at 20:54 +1100, Alexandre Courbot <acourbot@...dia.com> wrote...
> `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`.

Much nicer, thanks.

Reviewed-by: Alistair Popple <apopple@...dia.com>

> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
> ---
>  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 0425c65b5d6f..2050771f9b53 100644
> --- a/drivers/gpu/nova-core/gsp/commands.rs
> +++ b/drivers/gpu/nova-core/gsp/commands.rs
> @@ -142,7 +142,7 @@ fn init_variable_payload(
>  }
>  
>  /// 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<array::IntoIter<&[u8], 2>>,
>      ) -> Result<Self, Self::InitError> {
> -        Ok(GspInitDone {})
> +        Ok(GspInitDone)
>      }
>  }
>  
> 
> -- 
> 2.52.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ