hv: pci: update function "bdf_is_equal"
- update the function argument type to union Declaring argument as pointer is not necessary since it only does the comparison. Tracked-On: #1842 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
This commit is contained in:
parent
658fff27b4
commit
c8bcab9006
|
@ -37,7 +37,7 @@ static bool is_allocated_to_prelaunched_vm(struct pci_pdev *pdev)
|
|||
for (pci_idx = 0U; pci_idx < vm_config->pci_dev_num; pci_idx++) {
|
||||
dev_config = &vm_config->pci_devs[pci_idx];
|
||||
if ((dev_config->emu_type == PCI_DEV_TYPE_PTDEV) &&
|
||||
bdf_is_equal(&dev_config->pbdf, &pdev->bdf)) {
|
||||
bdf_is_equal(dev_config->pbdf, pdev->bdf)) {
|
||||
dev_config->pdev = pdev;
|
||||
found = true;
|
||||
break;
|
||||
|
|
|
@ -83,7 +83,7 @@ struct pci_vdev *pci_find_vdev(const struct acrn_vpci *vpci, union pci_bdf vbdf)
|
|||
for (i = 0U; i < vpci->pci_vdev_cnt; i++) {
|
||||
tmp = (struct pci_vdev *)&(vpci->pci_vdevs[i]);
|
||||
|
||||
if (bdf_is_equal(&(tmp->bdf), &vbdf)) {
|
||||
if (bdf_is_equal(tmp->bdf, vbdf)) {
|
||||
vdev = tmp;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -282,13 +282,9 @@ static inline uint64_t git_size_masked_bar_base(uint64_t size, uint64_t val)
|
|||
return (mask & val);
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre a != NULL
|
||||
* @pre b != NULL
|
||||
*/
|
||||
static inline bool bdf_is_equal(const union pci_bdf *a, const union pci_bdf *b)
|
||||
static inline bool bdf_is_equal(union pci_bdf a, union pci_bdf b)
|
||||
{
|
||||
return (a->value == b->value);
|
||||
return (a.value == b.value);
|
||||
}
|
||||
|
||||
uint32_t pci_pdev_read_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes);
|
||||
|
|
Loading…
Reference in New Issue