Re: [PATCH v2 2/3] rust: pci: return a bitfield type for dev_id
From: Gary Guo
Date: Mon Nov 30 2026 - 11:40:49 EST
On Mon Nov 30, 2026 at 1:59 PM GMT, Alexandre Courbot wrote:
> The return type of `dev_id` has a well-defined bit layout encoding
> the bus, device and function IDs of the PCI device. Add a `Bdf` bitfield
> defining that layout and make `dev_id` return it so users can benefit
> from it and are not tempted to define their own BDF type.
>
> Also update the current two users of `dev_id`.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> Acked-by: Danilo Krummrich <dakr@xxxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> drivers/gpu/nova-core/gsp/fw/commands.rs | 2 +-
> rust/kernel/pci.rs | 34 ++++++++++++++++++++++++++++++--
> samples/rust/rust_driver_sriov/pf.rs | 2 +-
> 3 files changed, 34 insertions(+), 4 deletions(-)