HV: define function bdf_is_equal() to compare bdf

Use a function to compare bdf instead and some related code cleanup

Tracked-On: #2534
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
dongshen
2019-02-22 15:25:04 -08:00
committed by Eddie Dong
parent 028663537a
commit 4d11985366
4 changed files with 20 additions and 8 deletions

View File

@@ -407,7 +407,7 @@ struct pci_pdev *find_pci_pdev(union pci_bdf pbdf)
uint32_t i;
for (i = 0U; i < num_pci_pdev; i++) {
if (pci_pdev_array[i].bdf.value == pbdf.value) {
if (bdf_is_equal(&pci_pdev_array[i].bdf, &pbdf)) {
pdev = &pci_pdev_array[i];
break;
}