]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpu: nova-core: use `try_from` instead of `as` for u32 conversions
authorAlexandre Courbot <acourbot@nvidia.com>
Tue, 28 Oct 2025 23:12:11 +0000 (08:12 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Tue, 4 Nov 2025 04:26:54 +0000 (13:26 +0900)
commit6553a8f168fb7941ae73d39eccac64f3a2b9b399
tree9587545e99edd6e6ba3e47fc0e840e6c42b72c5c
parent505c3ec507a7eb4bbaef9aa8b13b6452e86baca2
gpu: nova-core: use `try_from` instead of `as` for u32 conversions

There are a few situations in the driver where we convert a `usize` into
a `u32` using `as`. Even though most of these are obviously correct, use
`try_from` and let the compiler optimize wherever it is safe to do so.

Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Message-ID: <20251029-nova-as-v3-3-6a30c7333ad9@nvidia.com>
drivers/gpu/nova-core/fb/hal/tu102.rs
drivers/gpu/nova-core/firmware/fwsec.rs