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

Adam Jackson ajax at redhat.com
Wed Sep 20 17:31:17 UTC 2017


On Mon, 2017-09-18 at 21:33 +0100, Emil Velikov wrote:
> 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?

Yeah, pretty sure I just typed that without thinking to be clear that
it was being clamped, any remotely reasonable compiler is going to
optimize it out of existence.

- ajax


More information about the xorg-devel mailing list