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

@@ -220,6 +220,14 @@ static inline uint8_t pci_devfn(uint16_t bdf)
return (uint8_t)(bdf & 0xFFU);
}
/*
* @pre a != NULL && b != NULL
*/
static inline bool bdf_is_equal(const union pci_bdf *a, const union pci_bdf *b)
{
return (a->value == b->value);
}
uint32_t pci_pdev_read_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes);
void pci_pdev_write_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes, uint32_t val);
void enable_disable_pci_intx(union pci_bdf bdf, bool enable);