Alexandre Courbot
2025-Sep-29 06:22 UTC
[PATCH v4 2/6] nova-core: bitfield: Add support for different storage widths
On Sun Sep 21, 2025 at 3:22 AM JST, Joel Fernandes wrote:> Previously, bitfields were hardcoded to use u32 as the underlying > storage type. Add support for different storage types (u8, u16, u32, > u64) to the bitfield macro. > > New syntax is: struct Name: <type ex., u32> { ... } > > Reviewed-by: Elle Rhumsaa <elle at weathered-steel.dev> > Signed-off-by: Joel Fernandes <joelagnelf at nvidia.com> > --- > drivers/gpu/nova-core/bitfield.rs | 71 +++++++++++++++++----------- > drivers/gpu/nova-core/regs/macros.rs | 16 +++---- > 2 files changed, 52 insertions(+), 35 deletions(-) > > diff --git a/drivers/gpu/nova-core/bitfield.rs b/drivers/gpu/nova-core/bitfield.rs > index ba6b7caa05d9..687ef234be75 100644 > --- a/drivers/gpu/nova-core/bitfield.rs > +++ b/drivers/gpu/nova-core/bitfield.rs > @@ -51,7 +51,7 @@ > //! } > //! > //! bitfield! { > -//! struct ControlReg { > +//! struct ControlReg: u32 {Haven't we agreed in [1] to align the type definition syntax to that of an actual Rust struct? E.g. `struct ControlReg(u32)`? [1] https://lore.kernel.org/all/3814d6b7-7551-4e8c-b78a-4ac6236eb406 at nvidia.com/