Re: [PATCH v8 1/1] rust: pci: add extended capability and SR-IOV support
"Alexandre Courbot" <[email protected]>
| Newsgroups | org.kernel.vger.rust-for-linux,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <[email protected]> |
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/[email protected]/
Ok, I'll try to send the v2 of `const_as!` promptly then.