hv: code clean-up in `hw/pci.c`
* move `pci_pdev_calc_address` out of the spinlock in
`pci_pdev_read_cfg`
* remove the spaces before tabs
* make the line not over 120 characters
Acked-by: Eddie Dong
@@ -49,10 +49,10 @@ uint32_t pci_pdev_read_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes)
uint32_t addr;
uint32_t val;
- spinlock_obtain(&pci_device_lock);
-
addr = pci_pdev_calc_address(bdf, offset);
+ spinlock_obtain(&pci_device_lock);
+
/* Write address to ADDRESS register */
pio_write32(addr, (uint16_t)PCI_CONFIG_ADDR);
@@ -171,7 +171,8 @@ void pci_scan_bus(pci_enumeration_cb cb_func, void *cb_data)
/* Secondary bus to be scanned */
secondary_bus = (uint8_t)pci_pdev_read_cfg(pbdf, PCIR_SECBUS_1, 1U);
if (bus_to_scan[secondary_bus] != BUS_SCAN_SKIP) {
- pr_err("%s, bus %d may be downstream of different PCI bridges", secondary_bus);
+ pr_err("%s, bus %d may be downstream of different PCI bridges",
+ secondary_bus);
} else {
bus_to_scan[secondary_bus] = BUS_SCAN_PENDING;
}
