Re: [PATCH v2] gpu: nova-core: parse structs via zerocopy
From: Alexandre Courbot
Date: Tue Jun 30 2026 - 10:10:15 EST
On Mon Jun 29, 2026 at 11:20 PM JST, Nicolás Antinori wrote:
> Replace the unsafe `kernel::transmute::FromBytes` trait implementation
> for the `FalconUCodeDescV3`, `PcirStruct`, `BitHeader`, `BitToken`,
> `NpdeStruct`, `PciRomHeader`, `PmuLookupTableEntry` and
> `PmuLookupTableHeader` structs with the derivable `zerocopy::FromBytes`
> trait.
>
> This change eliminates the manual unsafe implementations in favor of a
> derivable trait. When this trait is derived, validity checks are
> performed at compile time to ensure that the type can safely implement
> `FromBytes`.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1241
> Suggested-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
> Signed-off-by: Nicolás Antinori <nico.antinori.7@xxxxxxxxx>
Pushed to `drm-rust-next`, thanks!
[acourbot: add `vbios:` prefix to commit title.]