The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] rust: io: fix example in `register!` macro
@ 2026-07-01 16:03 Link Mauve
  2026-07-01 16:09 ` Gary Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Link Mauve @ 2026-07-01 16:03 UTC (permalink / raw)
  To: Danilo Krummrich, Alice Ryhl, Daniel Almeida, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Trevor Gross, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan, driver-core, rust-for-linux,
	linux-kernel
  Cc: Link Mauve

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@linkmauve.fr>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-03 21:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 16:03 [PATCH] rust: io: fix example in `register!` macro Link Mauve
2026-07-01 16:09 ` Gary Guo
2026-07-03  5:17 ` Alexandre Courbot
2026-07-03 21:22 ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox