]> Gentwo Git Trees - linux/.git/commitdiff
gpu: nova-core: vbios: do not use `as` when comparing BiosImageType
authorAlexandre Courbot <acourbot@nvidia.com>
Tue, 28 Oct 2025 23:12:10 +0000 (08:12 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Tue, 4 Nov 2025 04:26:26 +0000 (13:26 +0900)
Use the `image_type` method and compare its result to avoid using `as`.

Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Message-ID: <20251029-nova-as-v3-2-6a30c7333ad9@nvidia.com>

drivers/gpu/nova-core/vbios.rs

index 74ed6d61e6cc7e698691c180a33f5b3f24783a2a..9283921e89c3b18f179201cc6247c130b1f7f3af 100644 (file)
@@ -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) {
             return true;
         }