* [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
* Re: [PATCH] rust: io: fix example in `register!` macro
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
2 siblings, 0 replies; 4+ messages in thread
From: Gary Guo @ 2026-07-01 16:09 UTC (permalink / raw)
To: Link Mauve, 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
On Wed Jul 1, 2026 at 5:03 PM BST, Link Mauve wrote:
> 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>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> rust/kernel/io/register.rs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: io: fix example in `register!` macro
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
2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Courbot @ 2026-07-03 5:17 UTC (permalink / raw)
To: Link Mauve
Cc: Danilo Krummrich, Alice Ryhl, Daniel Almeida, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Tamir Duberstein, Onur Özkan,
driver-core, rust-for-linux, linux-kernel
On Thu Jul 2, 2026 at 1:03 AM JST, Link Mauve wrote:
> 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>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: io: fix example in `register!` macro
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
2 siblings, 0 replies; 4+ messages in thread
From: Danilo Krummrich @ 2026-07-03 21:22 UTC (permalink / raw)
To: Link Mauve
Cc: 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
On Wed, 1 Jul 2026 18:03:54 +0200, Link Mauve wrote:
> [PATCH] rust: io: fix example in `register!` macro
Applied, thanks!
Branch: driver-core-testing
Tree: git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
[1/1] rust: io: fix example in `register!` macro
commit: 5dcef303b29f
The patch will appear in the next linux-next integration (typically within 24
hours on weekdays).
The patch is in the driver-core-testing branch and will be promoted to
driver-core-next after validation.
^ permalink raw reply [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