[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251103203138.GA2098593@joelbox2>
Date: Mon, 3 Nov 2025 15:31:38 -0500
From: Joel Fernandes <joelagnelf@...dia.com>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: Alice Ryhl <aliceryhl@...gle.com>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
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>,
Trevor Gross <tmgross@...ch.edu>,
John Hubbard <jhubbard@...dia.com>,
Alistair Popple <apopple@...dia.com>, Timur Tabi <ttabi@...dia.com>,
Edwin Peer <epeer@...dia.com>, nouveau@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org, Danilo Krummrich <dakr@...nel.org>
Subject: Re: [PATCH v3 2/6] gpu: nova-core: vbios: do not use `as` when
comparing BiosImageType
On Wed, Oct 29, 2025 at 08:12:10AM +0900, Alexandre Courbot wrote:
> Use the `image_type` method and compare its result to avoid using `as`.
>
> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
> ---
> drivers/gpu/nova-core/vbios.rs | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/vbios.rs b/drivers/gpu/nova-core/vbios.rs
> index 74ed6d61e6cc..7c1bf10b2eac 100644
> --- a/drivers/gpu/nova-core/vbios.rs
> +++ b/drivers/gpu/nova-core/vbios.rs
> @@ -709,9 +709,8 @@ fn image_type(&self) -> Result<BiosImageType> {
>
> /// Check if this is the last image.
> fn is_last(&self) -> bool {
> - // For NBSI images (type == 0x70), return true as they're
> - // considered the last image
> - if self.pcir.code_type == BiosImageType::Nbsi as u8 {
> + // For NBSI images, return true as they're considered the last image
> + if self.image_type() == Ok(BiosImageType::Nbsi) {
nit: Could you add period at the end of the comment sentence as Miguel
suggested in the other thread (which I admit the initial code also didn't
have)?
With that change,
Reviewed-by: Joel Fernandes <joelagnelf@...dia.com>
thanks,
- Joel
> return true;
> }
>
>
> --
> 2.51.0
>
Powered by blists - more mailing lists