Re: [PATCH v2] rust: of: replace `core::mem::zeroed` with `pin_init::zeroed`
From: Danilo Krummrich
Date: Fri Oct 31 2025 - 05:55:45 EST
On 10/31/25 10:51 AM, Moritz Zielke via B4 Relay wrote:
> From: Moritz Zielke <moritz.zielke@xxxxxxxxx>
>
> All types in `bindings` implement `Zeroable` if they can, so use
> `pin_init::zeroed` instead of relying on `unsafe` code.
>
> If this ends up not compiling in the future, something in bindgen or on
> the C side changed and is most likely incorrect.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1189
> Suggested-by: Benno Lossin <lossin@xxxxxxxxxx>
> Signed-off-by: Moritz Zielke <moritz.zielke@xxxxxxxxx>
Reviewed-by: Danilo Krummrich <dakr@xxxxxxxxxx>