hv: minor cleanup for dm/vpci code

- It makes more sense to return bool from pci_bar_access()
- other minor changes for cleanup

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Zide Chen
2018-10-24 15:54:41 -07:00
committed by lijinxia
parent bc4f82d1d1
commit 7b4b78c323
2 changed files with 12 additions and 12 deletions

View File

@@ -144,16 +144,16 @@ enum pci_bar_type {
static inline uint32_t pci_bar_offset(uint32_t idx)
{
return 0x10U + (idx << 2U);
return PCIR_BARS + (idx << 2U);
}
static inline int pci_bar_access(uint32_t offset)
static inline bool pci_bar_access(uint32_t offset)
{
if ((offset >= pci_bar_offset(0U))
&& (offset < pci_bar_offset(PCI_BAR_COUNT))) {
return 1;
return true;
} else {
return 0;
return false;
}
}