From 5dcef303b29f004a447d9c69e62963328da9c608 Mon Sep 17 00:00:00 2001 From: Link Mauve Date: Wed, 1 Jul 2026 18:03:54 +0200 Subject: [PATCH] rust: io: fix example in `register!` macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Alexandre Courbot Reviewed-by: Gary Guo Link: https://patch.msgid.link/20260701160357.29031-1-linkmauve@linkmauve.fr Signed-off-by: Danilo Krummrich --- 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) { /// /// register! { /// FIXED_REG(u32) @ 0x100 { -/// 16:8 high_byte; +/// 15:8 high_byte; /// 7:0 low_byte; /// } /// }