mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-04 09:50:54 +00:00
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 Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
2756ec740d
commit
2c6b43070b
@ -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 addr;
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
|
|
||||||
spinlock_obtain(&pci_device_lock);
|
|
||||||
|
|
||||||
addr = pci_pdev_calc_address(bdf, offset);
|
addr = pci_pdev_calc_address(bdf, offset);
|
||||||
|
|
||||||
|
spinlock_obtain(&pci_device_lock);
|
||||||
|
|
||||||
/* Write address to ADDRESS register */
|
/* Write address to ADDRESS register */
|
||||||
pio_write32(addr, (uint16_t)PCI_CONFIG_ADDR);
|
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 to be scanned */
|
||||||
secondary_bus = (uint8_t)pci_pdev_read_cfg(pbdf, PCIR_SECBUS_1, 1U);
|
secondary_bus = (uint8_t)pci_pdev_read_cfg(pbdf, PCIR_SECBUS_1, 1U);
|
||||||
if (bus_to_scan[secondary_bus] != BUS_SCAN_SKIP) {
|
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 {
|
} else {
|
||||||
bus_to_scan[secondary_bus] = BUS_SCAN_PENDING;
|
bus_to_scan[secondary_bus] = BUS_SCAN_PENDING;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user