summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2026-06-06 15:43:04 +0300
committerMiguel Ojeda <ojeda@kernel.org>2026-06-09 05:12:51 +0300
commitb7b8b4ccdad45a59aafa5cfc32a51fe1ee5cb680 (patch)
treec9b5b2febb146c97e81be72dca9a6d1e89efc2c0 /include
parent09699b24199ac546037de252ba4907d99f4a8c7a (diff)
downloadlinux-b7b8b4ccdad45a59aafa5cfc32a51fe1ee5cb680.tar.xz
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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions