]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: io: use generic read/write accessors for primitive accesses
authorAlexandre Courbot <acourbot@nvidia.com>
Sat, 14 Mar 2026 01:06:16 +0000 (10:06 +0900)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 17 Mar 2026 19:04:11 +0000 (20:04 +0100)
commit147b41ba23d63f43ed34e6940417a5506e323370
tree2520e5dd96a27674f24e41ecf5eae2eb8e6a56eb
parent498823541be1e2d9f947b37a10cc98e681da9828
rust: io: use generic read/write accessors for primitive accesses

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>
Link: https://patch.msgid.link/20260314-register-v9-6-86805b2f7e9d@nvidia.com
[ Slightly improve wording in doc-comment. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/io.rs