Re: [PATCH v6 RESEND 4/7] rust: io: factor common I/O helpers into Io trait

From: Alexandre Courbot

Date: Thu Nov 13 2025 - 02:36:49 EST


Hi Zhi,

On Tue Nov 11, 2025 at 5:41 AM JST, Zhi Wang wrote:
> The previous Io<SIZE> type combined both the generic I/O access helpers
> and MMIO implementation details in a single struct.
>
> To establish a cleaner layering between the I/O interface and its concrete
> backends, paving the way for supporting additional I/O mechanisms in the
> future, Io<SIZE> need to be factored.
>
> Factor the common helpers into a new Io trait, and move the MMIO-specific
> logic into a dedicated Mmio<SIZE> type implementing that trait. Rename the
> IoRaw to MmioRaw and update the bus MMIO implementations to use MmioRaw.
>
> No functional change intended.
>
> Cc: Alexandre Courbot <acourbot@xxxxxxxxxx>
> Cc: Bjorn Helgaas <helgaas@xxxxxxxxxx>
> Cc: Danilo Krummrich <dakr@xxxxxxxxxx>
> Cc: John Hubbard <jhubbard@xxxxxxxxxx>
> Signed-off-by: Zhi Wang <zhiw@xxxxxxxxxx>

This is looking quite good to me! I tried really hard to find stuff to
comment about, but couldn't. :)

Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>