Re: [PATCH v9 06/10] rust: io: use generic read/write accessors for primitive accesses

Gary Guo
2026-03-14T13:42:28Z

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@nvidia.com>

Reviewed-by: Gary Guo <gary@garyguo.net>

> ---
> rust/kernel/io.rs | 218 +++++++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 150 insertions(+), 68 deletions(-)