Re: [PATCH 4/6] rust: io: remove legacy relaxed accessors of Mmio

Daniel Almeida
2026-02-04T15:20:38Z

> On 2 Feb 2026, at 05:13, Alexandre Courbot <acourbot@nvidia.com> wrote:
>
> The relaxed access functionality is now provided by the `RelaxedMmio`
> wrapper type, and we don't have any user of the legacy methods left.
> Remove them.
>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
> rust/kernel/io.rs | 40 ----------------------------------------
> 1 file changed, 40 deletions(-)
>
> diff --git a/rust/kernel/io.rs b/rust/kernel/io.rs
> index baa8d3baa20c..e1094a237ff7 100644
> --- a/rust/kernel/io.rs
> +++ b/rust/kernel/io.rs
> @@ -660,46 +660,6 @@ pub unsafe fn from_raw(raw: &MmioRaw<SIZE>) -> &Self {
> // SAFETY: `Mmio` is a transparent wrapper around `MmioRaw`.
> unsafe { &*core::ptr::from_ref(raw).cast() }
> }
> -
> - define_read!(infallible, pub read8_relaxed, call_mmio_read(readb_relaxed) -> u8);
> - define_read!(infallible, pub read16_relaxed, call_mmio_read(readw_relaxed) -> u16);
> - define_read!(infallible, pub read32_relaxed, call_mmio_read(readl_relaxed) -> u32);
> - define_read!(
> - infallible,
> - #[cfg(CONFIG_64BIT)]
> - pub read64_relaxed,
> - call_mmio_read(readq_relaxed) -> u64
> - );
> -
> - define_read!(fallible, pub try_read8_relaxed, call_mmio_read(readb_relaxed) -> u8);
> - define_read!(fallible, pub try_read16_relaxed, call_mmio_read(readw_relaxed) -> u16);
> - define_read!(fallible, pub try_read32_relaxed, call_mmio_read(readl_relaxed) -> u32);
> - define_read!(
> - fallible,
> - #[cfg(CONFIG_64BIT)]
> - pub try_read64_relaxed,
> - call_mmio_read(readq_relaxed) -> u64
> - );
> -
> - define_write!(infallible, pub write8_relaxed, call_mmio_write(writeb_relaxed) <- u8);
> - define_write!(infallible, pub write16_relaxed, call_mmio_write(writew_relaxed) <- u16);
> - define_write!(infallible, pub write32_relaxed, call_mmio_write(writel_relaxed) <- u32);
> - define_write!(
> - infallible,
> - #[cfg(CONFIG_64BIT)]
> - pub write64_relaxed,
> - call_mmio_write(writeq_relaxed) <- u64
> - );
> -
> - define_write!(fallible, pub try_write8_relaxed, call_mmio_write(writeb_relaxed) <- u8);
> - define_write!(fallible, pub try_write16_relaxed, call_mmio_write(writew_relaxed) <- u16);
> - define_write!(fallible, pub try_write32_relaxed, call_mmio_write(writel_relaxed) <- u32);
> - define_write!(
> - fallible,
> - #[cfg(CONFIG_64BIT)]
> - pub try_write64_relaxed,
> - call_mmio_write(writeq_relaxed) <- u64
> - );
> }
>
> /// [`Mmio`] wrapper using relaxed accessors.
>
> --
> 2.52.0
>
>

Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>