Commit e6b8932b authored by Alexandre Courbot's avatar Alexandre Courbot
Browse files

gpu: nova-core: bitfield: simplify expression



The shift is more easily expressed by the index of the lowest bit of the
field.

Reported-by: default avatarEdwin Peer <epeer@nvidia.com>
Link: https://lore.kernel.org/rust-for-linux/F3853912-2C1C-4F9B-89B0-3168689F35B3@nvidia.com/


Reviewed-by: default avatarJoel Fernandes <joelagnelf@nvidia.com>
Reviewed-by: default avatarDanilo Krummrich <dakr@kernel.org>
Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Message-ID: <20251022-nova-bitfield-v1-2-73bc0988667b@nvidia.com>
parent fa08ec78
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ impl $name {
                _ => ::kernel::build_error!("Unsupported storage type size")
            }
        };
        const [<$field:upper _SHIFT>]: u32 = Self::[<$field:upper _MASK>].trailing_zeros();
        const [<$field:upper _SHIFT>]: u32 = $lo;
        );

        $(