[Skiboot] [PATCH 8/9] npu2: Remove redundant assignment to p->phb_nvlink.scan_map
Reza Arbab
arbab at linux.ibm.com
Thu Jan 10 02:58:50 AEDT 2019
In npu2_populate_devices(), we do
p->phb_nvlink.scan_map |= 0x1 << ((dev->bdfn & 0xf8) >> 3);
:
dev->nvlink.pvd = pci_virt_add_device(&p->phb_nvlink, dev->bdfn, 0x100, dev);
/* At this point, dev->nvlink.pvd->bdfn = dev->bdfn */
if (dev->nvlink.pvd) {
p->phb_nvlink.scan_map |= 0x1 << ((dev->nvlink.pvd->bdfn & 0xf8) >> 3);
:
}
Because dev->nvlink.pvd->bdfn equals dev->bdfn, the second assignment to
scan_map is redundant. Remove it.
Signed-off-by: Reza Arbab <arbab at linux.ibm.com>
---
hw/npu2.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/hw/npu2.c b/hw/npu2.c
index 8418e04..68a5382 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -1838,11 +1838,8 @@ static void npu2_populate_devices(struct npu2 *p,
/* Initialize PCI virtual device */
dev->nvlink.pvd = pci_virt_add_device(&p->phb_nvlink, dev->bdfn, 0x100, dev);
- if (dev->nvlink.pvd) {
- p->phb_nvlink.scan_map |=
- 0x1 << ((dev->nvlink.pvd->bdfn & 0xf8) >> 3);
+ if (dev->nvlink.pvd)
npu2_populate_cfg(dev);
- }
index++;
}
--
1.8.3.1
More information about the Skiboot
mailing list