Re: [PATCH v9 06/10] rust: io: use generic read/write accessors for primitive accesses
From: Gary Guo
Date: Sat Mar 14 2026 - 09:43:05 EST
On Sat Mar 14, 2026 at 1:06 AM GMT, Alexandre Courbot wrote:
> By providing the required `IoLoc` implementations on `usize`, we can
> leverage the generic accessors and reduce the number of unsafe blocks in
> the module.
>
> This also allows us to directly call the generic `read/write/update`
> methods with primitive types, so add examples illustrating this.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> rust/kernel/io.rs | 218 +++++++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 150 insertions(+), 68 deletions(-)