Re: [PATCH] rust: iommu: replace core::mem::zeroed with pin_init::zeroed

Miguel Ojeda <[email protected]> Sun, 28 Jun 2026 12:31:31 +0200
Newsgroups dev.linux.lists.linux-kernel-mentees,dev.linux.lists.iommu,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux
Message-ID <CANiq72kdCAyRUmXFcqQfkHpk1miG8Gagsn0_5U8p4WpKxv9d_g@mail.gmail.com>
On Sat, Jun 27, 2026 at 10:35 AM Alexandre Courbot <[email protected]> wrote:
>
> Note that you can also use `..Zeroable::zeroed()` here since we are not
> in const context. Not sure which one we prefer in this case, but I'd
> personally err on the side of not referring to `pin_init` unless we are
> dealing with a pinned object or need to because of a const requirement.

That sounds reasonable -- Benno/Gary, any comments?

By the way, speaking of that: the docs of `zeroed()` (both of them)
could mention the existence of the other (and the `const fn`
difference).

I guess this will eventually go through IOMMU, but I can also take it
via `rust-next` if needed.

Thanks!

Cheers,
Miguel