[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DDN6B9VKK6O6.2SHDUYDMJCOG7@kernel.org>
Date: Mon, 20 Oct 2025 15:11:38 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Alice Ryhl" <aliceryhl@...gle.com>, "Siyuan Huang"
<huangsiyuan@...inos.cn>
Cc: <rafael@...nel.org>, <lenb@...nel.org>, <ojeda@...nel.org>,
<alex.gaynor@...il.com>, <boqun.feng@...il.com>, <gary@...yguo.net>,
<bjorn3_gh@...tonmail.com>, <a.hindborg@...nel.org>, <tmgross@...ch.edu>,
<dakr@...nel.org>, <linux-acpi@...r.kernel.org>,
<rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] rust: acpi: replace `core::mem::zeroed` with
`pin_init::zeroed`
On Mon Oct 20, 2025 at 10:18 AM CEST, Alice Ryhl wrote:
> 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@...nel.org>
>> Signed-off-by: Siyuan Huang <huangsiyuan@...inos.cn>
>
> 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.
Yeah, we should do that. I don't have time to do it, so if anyone wants
to go ahead, please do :)
Cheers,
Benno
Powered by blists - more mailing lists