Re: [PATCH v8 1/1] rust: pci: add extended capability and SR-IOV support
From: Danilo Krummrich
Date: Wed Aug 26 2026 - 07:36:26 EST
On Wed Aug 26, 2026 at 1:24 PM CEST, Alexandre Courbot wrote:
> Coming back to comment on the conclusion: we have settled on a solution
> [1] to handle this nicely, but it is likely that your series will land
> before it. So meanwhile, please use the turbofish solution that I
> initially proposed:
>
> pub const SRIOV: Self = Self(casts::u32_into_u16::<{ bindings::PCI_EXT_CAP_ID_SRIOV }>());
>
> While it's a mouthful, [1] does remove `u32_into_u16`, which means we
> won't miss it and will need to update the code to use `const_as!` when
> applying.
I don't think that works; your patch is not backwards compatible and removes
casts::u32_into_u16().
So either this should just be a regular as-cast, or we have a signed tag to
share with other trees for [1] early in the cycle. Since -rc1 isn't even out
yet, I'd prefer the latter.
> [1] https://lore.kernel.org/all/20260825-const_as-v1-1-1ce712225fe2@xxxxxxxxxx/