[PATCH libpciaccess] linux: support 32 bit PCI domains (v3)

Emil Velikov emil.l.velikov at gmail.com
Mon Sep 18 20:33:07 UTC 2017


Hi Adam,

A couple of question about the v3 changes. Hope I'm not loosing my marbles.

On 18 September 2017 at 18:17, Adam Jackson <ajax at redhat.com> wrote:

> --- a/src/netbsd_pci.c
> +++ b/src/netbsd_pci.c
> @@ -959,6 +959,10 @@ pci_system_netbsd_create(void)
>                                         continue;
>
>                                 device->base.domain = domain;
> +                               if (domain > 0xffff)
> +                                   device->base.domain_16 = 0xffff;
> +                               else
> +                                   device->base.domain_16 = domain & 0xffff;
In the else case domain is within [0..0xffff] thus the "& 0xffff" is a
noop. Right?

>                                 device->base.bus = bus;
>                                 device->base.dev = dev;
>                                 device->base.func = func;
> diff --git a/src/openbsd_pci.c b/src/openbsd_pci.c
> index b8ce318..c061fd8 100644
> --- a/src/openbsd_pci.c
> +++ b/src/openbsd_pci.c
> @@ -656,6 +656,10 @@ pci_system_openbsd_create(void)
>                                                 continue;
>
>                                         device->base.domain = domain;
> +                                       if (domain > 0xffff)
> +                                           device->base.domain_16 = 0xffff;
> +                                       else
> +                                           device->base.domain_16 = domain & 0xffff;
The same question also applies here.

Thanks
Emil


More information about the xorg-devel mailing list