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

From: Alice Ryhl

Date: Mon Oct 20 2025 - 04:18:51 EST


On Mon, Oct 20, 2025 at 11:12:04AM +0800, 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@xxxxxxxxxx>
> Signed-off-by: Siyuan Huang <huangsiyuan@xxxxxxxxxx>

We should make this method accessible under kernel::ffi:: since that's
IMO a better path for it for cases like this. It doesn't really have
anything to do with pin_init in this use-case.

Regardless:
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>