Files
linux-stable-mirror/rust/kernel
Alexandre Courbot b7b8b4ccda rust: extract bitfield! macro from register!
Extract the bitfield-defining part of the `register!` macro into an
independent macro used to define bitfield types with bounds-checked
accessors.

Each field is represented as a `Bounded` of the appropriate bit width,
ensuring field values are never silently truncated.

Fields can optionally be converted to/from custom types, either fallibly
or infallibly.

Appropriate documentation is also added, and a MAINTAINERS entry created
for the new module.

Two minor fixups are also applied: the private accessors are inlined,
and a couple of missing fully qualified types in the macro are fixed.

Acked-by: Yury Norov <ynorov@nvidia.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Yury Norov <ynorov@nvidia.com>
Link: https://patch.msgid.link/20260606-bitfield-v5-1-b92188820914@nvidia.com
[ Added some more intra-doc links. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2026-06-09 04:12:51 +02:00
..
2026-04-03 11:57:35 +02:00
2026-03-24 23:51:23 +01:00
2026-05-20 00:47:24 +02:00
2026-02-01 22:18:24 +01:00
2026-01-30 05:47:05 +01:00
2026-06-08 02:30:33 +02:00