[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 02/12] pci: introduce a pci_sbdf_t field to pci_dev



>>> On 06.06.19 at 11:01, <roger.pau@xxxxxxxxxx> wrote:
> And use an union with the current seg, bus and devfn fields to make
> fields point to the same underlying data.
> 
> No functional change.
> 
> Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
with one question:

> --- a/xen/include/xen/pci.h
> +++ b/xen/include/xen/pci.h
> @@ -83,9 +83,15 @@ struct pci_dev {
>      struct arch_msix *msix;
>  
>      struct domain *domain;
> -    const u16 seg;
> -    const u8 bus;
> -    const u8 devfn;
> +
> +    union {
> +        struct {
> +            const uint8_t devfn;
> +            const uint8_t bus;
> +            const uint16_t seg;
> +        };
> +        const pci_sbdf_t sbdf;
> +    };

Doesn't sticking a single "const" at the union have the same effect?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.