Re: [PATCH] rust_binder: use pin_init::zeroed for file_operations initialization

"Alexandre Courbot" <[email protected]> Sat, 27 Jun 2026 17:25:11 +0900
Newsgroups dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Sat Jun 27, 2026 at 6:44 AM JST, Nicolás Antinori wrote:
> All types in `bindings` implement `Zeroable` if they can. This enables
> using `pin_init::zeroed()` for `file_operations` initialization instead
> of relying on `unsafe { core::mem::MaybeUninit::zeroed().assume_init() }`.
>
> This change improves readability and removes an unnecessary unsafe
> block.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1189
> Suggested-by: Benno Lossin <[email protected]>
> Signed-off-by: Nicolás Antinori <[email protected]>

Reviewed-by: Alexandre Courbot <[email protected]>