diff options
author | Jordan Niethe <jniethe5@gmail.com> | 2019-08-09 14:12:20 +1000 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-08-16 15:51:55 +1000 |
commit | e4e2aa9cc2cbaab9c6c0ee3a1f4e36292128762a (patch) | |
tree | 3baf40df5b7ccde86c729634583655252a478530 /platforms/astbmc | |
parent | f68639c6fcdf9261290a4601eda1ae6a406ba95a (diff) | |
download | skiboot-e4e2aa9cc2cbaab9c6c0ee3a1f4e36292128762a.zip skiboot-e4e2aa9cc2cbaab9c6c0ee3a1f4e36292128762a.tar.gz skiboot-e4e2aa9cc2cbaab9c6c0ee3a1f4e36292128762a.tar.bz2 |
pci: Use a macro for accessing PCI BDF Function Number
Currently when the Function Number bits of a BDF are needed the bit
operations to get it are free coded. There are many places where the
Function Number is used, so make a macro to use instead of free coding
it everytime.
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'platforms/astbmc')
-rw-r--r-- | platforms/astbmc/vesnin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platforms/astbmc/vesnin.c b/platforms/astbmc/vesnin.c index 3204bc5..bd412aa 100644 --- a/platforms/astbmc/vesnin.c +++ b/platforms/astbmc/vesnin.c @@ -269,7 +269,7 @@ static int pciinv_walk(struct phb *phb, struct pci_device *pd, void *data) pack->device.domain_num = cpu_to_be16(phb->opal_id & 0xffff); pack->device.bus_num = PCI_BUS_NUM(pd->bdfn); pack->device.device_num = PCI_DEV(pd->bdfn); - pack->device.func_num = pd->bdfn & 0x7; + pack->device.func_num = PCI_FUNC(pd->bdfn); pack->device.vendor_id = cpu_to_be16(PCI_VENDOR_ID(pd->vdid)); pack->device.device_id = cpu_to_be16(PCI_DEVICE_ID(pd->vdid)); pack->device.class_code = cpu_to_be32(pd->class & 0xffffff); |