[PATCH] rust: io: fix example in `register!` macro
From: Link Mauve
Date: Wed Jul 01 2026 - 12:20:54 EST
In this example, an u32 register is split in two u8 in big-endian order,
but the high byte is actually defined as taking nine bits instead of
eight.
This is completely inconsequential, as I expect most users will just
copy the bit ranges from their datasheets, but it doesn’t hurt to fix
that typo.
Signed-off-by: Link Mauve <linkmauve@xxxxxxxxxxxx>
---
rust/kernel/io/register.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/io/register.rs b/rust/kernel/io/register.rs
index f924c7c7c1db..66449377a0b7 100644
--- a/rust/kernel/io/register.rs
+++ b/rust/kernel/io/register.rs
@@ -448,7 +448,7 @@ fn into_io_op(self) -> (FixedRegisterLoc<T>, T) {
///
/// register! {
/// FIXED_REG(u32) @ 0x100 {
-/// 16:8 high_byte;
+/// 15:8 high_byte;
/// 7:0 low_byte;
/// }
/// }
--
2.55.0