Re: [PATCH v4 05/20] rust: io: generalize `MmioRaw` to pointer to arbitrary type
From: Alexandre Courbot
Date: Mon Jun 15 2026 - 04:11:06 EST
On Fri Jun 12, 2026 at 1:28 AM JST, Gary Guo wrote:
> Conceptually, `MmioRaw` is just `__iomem *`, so it should work for any
> types. Update the existing use case where it represents a region of
> compile-time known minimum size and run-time known actual size to use the
> dynamic-sized type `Region<SIZE>` instead. Rename `maxsize` method to
> reflect that it is the actual size (not a bound) of the region.
>
> Implement `Clone` and `Copy` manually, which cannot be derived due to the
> generic parameter. The use of raw pointers also cause the `Send` and `Sync`
> auto trait implementation to be lost, so add them back by manual
> implementation.
>
> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
Sashiko's potential leak on ioremap's error path seems worthy of
investigation, but it is not introduced by this patch so:
Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>