Re: [PATCH v1] rust: pwm: use pin_init::zeroed() to initialize pwm_ops
From: Alexandre Courbot
Date: Sat May 30 2026 - 00:55:30 EST
On Sat May 30, 2026 at 12:38 AM JST, Francis Laniel wrote:
> Replace unsafe block containing core::mem::zeroed by calling
> pin_init::zeroed().
> This is safer, as this function is guarded by trait contrary to
> core::mem:zeroed().
Typo: core::mem::zeroed() (probably moot if you reuse Benno's commit
message as suggested by Miguel though).
> Also, we can call this because all fields in pwm_ops, i.e. function
> pointers in Option<> and usize, are Zeroable.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1189
> Signed-off-by: Francis Laniel <laniel_francis@xxxxxxxxxxxxxxxxxxx>
Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>