Re: [PATCH v2 01/15] rust: pci: declare IrqType and IrqTypes with impl_flags
From: Alexandre Courbot
Date: Sun Aug 30 2026 - 21:10:44 EST
On Sat Aug 29, 2026 at 10:22 AM JST, John Hubbard wrote:
> The kernel provides impl_flags! for declaring a bitmask type alongside
> the enum of its individual flags, generating the bit operators and the
> containment queries.
>
> IrqTypes open-coded that pattern with a with() builder, so a caller
> naming two interrupt types chained two calls onto IrqTypes::default().
>
> Declare both types through impl_flags!, so the same set reads as
> IrqType::Msi | IrqType::MsiX.
>
> Suggested-by: Gary Guo <gary@xxxxxxxxxxx>
> Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
Much better indeed.
Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>