hv: Refine code for API reduction

Removed the pci_vdev_write_cfg_u8/u16/u32 APIs and only used
pci_vdev_write_cfg as the API for writing vdev's cfgdata

Tracked-On: #4433

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yuan Liu
2020-03-09 10:56:47 +08:00
committed by wenlingz
parent b25d5fa502
commit 60a7c49bb0
6 changed files with 51 additions and 76 deletions

View File

@@ -37,30 +37,6 @@ static inline bool in_range(uint32_t value, uint32_t lower, uint32_t len)
return ((value >= lower) && (value < (lower + len)));
}
/**
* @pre vdev != NULL
*/
static inline void pci_vdev_write_cfg_u8(struct pci_vdev *vdev, uint32_t offset, uint8_t val)
{
vdev->cfgdata.data_8[offset] = val;
}
/**
* @pre vdev != NULL
*/
static inline void pci_vdev_write_cfg_u16(struct pci_vdev *vdev, uint32_t offset, uint16_t val)
{
vdev->cfgdata.data_16[offset >> 1U] = val;
}
/**
* @pre vdev != NULL
*/
static inline void pci_vdev_write_cfg_u32(struct pci_vdev *vdev, uint32_t offset, uint32_t val)
{
vdev->cfgdata.data_32[offset >> 2U] = val;
}
/**
* @pre vdev != NULL
*/