Re: [PATCH] rust: acpi: replace `core::mem::zeroed` with `pin_init::zeroed`

Danilo Krummrich
2025-10-20T13:17:52Z

On 10/20/25 5:12 AM, Siyuan Huang wrote:
> 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@kernel.org>
> Signed-off-by: Siyuan Huang <huangsiyuan@kylinos.cn>

Acked-by: Danilo Krummrich <dakr@kernel.org>

Siyuan, there are more such cases, e.g. in OF, debugfs and a few others in case
you're interested in fixing up those as well. :)