Re: [PATCH v8 1/1] rust: pci: add extended capability and SR-IOV support

From: Alexandre Courbot

Date: Wed Aug 26 2026 - 09:36:00 EST


On Wed Aug 26, 2026 at 8:32 PM JST, Danilo Krummrich wrote:
> 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/

Ok, I'll try to send the v2 of `const_as!` promptly then.