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

Alice Ryhl <[email protected]> Thu, 2 Jul 2026 11:08:56 +0000
Newsgroups dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Fri, Jun 26, 2026 at 06:44:02PM -0300, 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: Alice Ryhl <[email protected]>