Re: [PATCH v2] rust: impl_flags: use bit helper in example
From: Miguel Ojeda
Date: Sat Jul 11 2026 - 05:28:26 EST
On Sat, Jul 11, 2026 at 10:23 AM Kosumi Chan <chankocyo@xxxxxxxxx> wrote:
>
> Use bit_u32() instead of open-coding shifts in the impl_flags! example.
> This demonstrates the checked bit helper and ensures that bit positions
> remain within the underlying u32 type.
>
> Suggested-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/linux/issues/1244
> Assisted-by: OpenCode:openai/gpt-5.6-sol
> Signed-off-by: Kosumi Chan <chankocyo@xxxxxxxxx>
Looks fine, thanks.
I think I will add:
Suggested-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/rust-for-linux/2026071054-hazing-antirust-8e40@gregkh/
since Greg suggested the original change/idea even if not the one here.
Cheers,
Miguel