Re: [PATCH v10 2/5] rust: io: separate generic I/O helpers from MMIO implementation

From: Alice Ryhl

Date: Tue Jan 20 2026 - 07:38:19 EST


On Tue, Jan 20, 2026 at 11:26:04AM +0000, Alice Ryhl wrote:
> On Tue, Jan 20, 2026 at 11:12:18AM +0100, Danilo Krummrich wrote:
> > On Tue Jan 20, 2026 at 9:04 AM CET, Alice Ryhl wrote:
> > > On Mon, Jan 19, 2026 at 10:22:44PM +0200, Zhi Wang wrote:
> > > Overall looks good to me. Some comments below:
> > >
> > > I still think it would make sense to have `IoCapable<T>: IoTryCapable<T>`,
> > > but it's not a big deal.
> >
> > I think with this approach it's not necessary to have this requirement. In
> > practice, most impls will have both, but I think it's a good thing that we don't
> > have to have an impl even if not used by any driver, i.e. it helps avoiding dead
> > code.
> >
> > >> + /// Infallible 64-bit read with compile-time bounds check.
> > >> + #[cfg(CONFIG_64BIT)]
> > >> + fn read64(&self, offset: usize) -> u64
> > >> + #[cfg(CONFIG_64BIT)]
> > >> + fn try_read64(&self, offset: usize) -> Result<u64>
> > >
> > > These don't really need cfg(CONFIG_64BIT). You can place that cfg on
> > > impl blocks of IoCapable<u64>.
> >
> > If you agree with the above, I can fix this up when applying the series.
>
> Ok with me.

with cfg(CONFIG_64BIT) adjusted:
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>