Re: [PATCH] rust: miscdevice: use `pin_init::zeroed()` for C type initialization
From: Miguel Ojeda
Date: Fri Nov 28 2025 - 14:08:19 EST
On Fri, Nov 28, 2025 at 5:23 PM Atharv Dubey <atharvd440@xxxxxxxxx> wrote:
>
> Replace manual zero-initialization using
> `MaybeUninit::zeroed().assume_init()` with `pin_init::zeroed()`.
> The `pin_init` helper provides a safer and clearer API for
> zero-initializing C structs without requiring an `unsafe` block.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1189
> Signed-off-by: Atharv Dubey <atharvd440@xxxxxxxxx>
Welcome! I am glad you ended up sending a patch :)
Minor procedural nit: I think this is missing:
Suggested-by: Benno Lossin <lossin@xxxxxxxxxx>
It should be picked up automatically, no need to resend a v2 just for this.
Thanks!
Cheers,
Miguel