mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
HV: extract common code blocks to has_msi_cap and has_msix_cap functions
Define has_msi_cap and has_msix_cap inline functions to do sanity checking for msi and msix ops, the corresponding code block in existing code is replaced with a call to these new functions. A few minor coding style fix. Tracked-On: #2534 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -152,15 +152,13 @@ static int32_t sharing_mode_vpci_init(const struct acrn_vm *vm)
|
||||
{
|
||||
struct pci_vdev *vdev;
|
||||
uint32_t i, j;
|
||||
int32_t ret;
|
||||
int32_t ret = -ENODEV;
|
||||
|
||||
/*
|
||||
* Only set up IO bitmap for SOS.
|
||||
* IO/MMIO requests from non-sos_vm guests will be injected to device model.
|
||||
*/
|
||||
if (!is_sos_vm(vm)) {
|
||||
ret = -ENODEV;
|
||||
} else {
|
||||
if (is_sos_vm(vm)) {
|
||||
/* Build up vdev array for sos_vm */
|
||||
pci_pdev_foreach(init_vdev_for_pdev, vm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user