On Tue, Dec 01, 2026 at 04:16:19PM +0900, Alexandre Courbot wrote: > The associated constants describing the range, mask and shift of each > field do not carry any doccomment. This triggers the `missing_docs` lint > on bitfields declared with `pub` visibility. > > Add a simple doccomment to get rid of that warning. > > Signed-off-by: Alexandre Courbot <[email protected]> > Reviewed-by: Eliot Courtney <[email protected]> > Reviewed-by: Gary Guo <[email protected]> > Reviewed-by: Danilo Krummrich <[email protected]>
Would be nice to have before and after examples in this sort of patches. Other than that, Acked-by: Yury Norov <[email protected]> > --- > rust/kernel/bitfield.rs | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/rust/kernel/bitfield.rs b/rust/kernel/bitfield.rs > index 8d7d78175336..22b1575c177c 100644 > --- a/rust/kernel/bitfield.rs > +++ b/rust/kernel/bitfield.rs > @@ -386,9 +386,12 @@ impl $name { > @private_field_accessors $vis:vis $name:ident $storage:ty : > $hi:tt:$lo:tt $field:ident > ) => { > ::kernel::macros::paste!( > + #[doc = concat!("Bit range of the `", stringify!($field), "` > field.")] > $vis const [<$field:upper _RANGE>]: ::core::ops::RangeInclusive<u8> > = $lo..=$hi; > + #[doc = concat!("Bit mask of the `", stringify!($field), "` field.")] > $vis const [<$field:upper _MASK>]: $storage = > ((((1 << $hi) - 1) << 1) + 1) - ((1 << $lo) - 1); > + #[doc = concat!("Bit shift of the `", stringify!($field), "` > field.")] > $vis const [<$field:upper _SHIFT>]: u32 = $lo; > ); > > > -- > 2.56.1
