[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DDZY6VI0PXCM.1VNOVU6JXWK6N@nvidia.com>
Date: Tue, 04 Nov 2025 22:34:24 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Joel Fernandes" <joelagnelf@...dia.com>, "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>,
"Nouveau" <nouveau-bounces@...ts.freedesktop.org>
Subject: Re: [PATCH v3 2/6] gpu: nova-core: vbios: do not use `as` when
comparing BiosImageType
On Tue Nov 4, 2025 at 5:31 AM JST, Joel Fernandes wrote:
> 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>
Done and merged this patch and patch 3/6, thanks! I will follow with the
rest this week unless someone screams at the kernel-wide RFC I send for
patch 4/6 [1].
[1] https://lore.kernel.org/rust-for-linux/20251104-as_casts-v1-1-0a0e95bd2a9f@nvidia.com/T/#u
Powered by blists - more mailing lists