mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 15:02:13 +00:00
hv:vtd: fix additional violations in vtd.c
this patch fix following violations: - Use of single line comment(s). - Logical conjunctions need brackets. - More than one break or goto statement in loop. Tracked-On: #861 Signed-off-by: Tw <wei.tan@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
3998c97756
commit
1dee629e75
@ -471,13 +471,8 @@ static struct dmar_drhd_rt *device_to_dmaru(uint16_t segment, uint8_t bus, uint8
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find exact one */
|
/* found exact one or the one which has the same segment number with INCLUDE_PCI_ALL set */
|
||||||
if (i != dmar_unit->drhd->dev_cnt) {
|
if ((i != dmar_unit->drhd->dev_cnt) || ((dmar_unit->drhd->flags & DRHD_FLAG_INCLUDE_PCI_ALL_MASK) != 0U)) {
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* has the same segment number and the dmar unit has INCLUDE_PCI_ALL set */
|
|
||||||
if ((dmar_unit->drhd->flags & DRHD_FLAG_INCLUDE_PCI_ALL_MASK) != 0U) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -847,7 +842,7 @@ static int32_t add_iommu_device(struct iommu_domain *domain, uint16_t segment, u
|
|||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
} else if (dmar_unit->drhd->ignore) {
|
} else if (dmar_unit->drhd->ignore) {
|
||||||
dev_dbg(ACRN_DBG_IOMMU, "device is ignored :0x%x:%x.%x", bus, pci_slot(devfun), pci_func(devfun));
|
dev_dbg(ACRN_DBG_IOMMU, "device is ignored :0x%x:%x.%x", bus, pci_slot(devfun), pci_func(devfun));
|
||||||
} else if (!dmar_unit_support_aw(dmar_unit, domain->addr_width) || (dmar_unit->root_table_addr == 0UL)) {
|
} else if ((!dmar_unit_support_aw(dmar_unit, domain->addr_width)) || (dmar_unit->root_table_addr == 0UL)) {
|
||||||
pr_err("invalid dmar unit");
|
pr_err("invalid dmar unit");
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
} else {
|
} else {
|
||||||
@ -856,7 +851,7 @@ static int32_t add_iommu_device(struct iommu_domain *domain, uint16_t segment, u
|
|||||||
if (vm != NULL) {
|
if (vm != NULL) {
|
||||||
vm->snoopy_mem = false;
|
vm->snoopy_mem = false;
|
||||||
}
|
}
|
||||||
// TODO: remove iommu_snoop from iommu_domain
|
/* TODO: remove iommu_snoop from iommu_domain */
|
||||||
domain->iommu_snoop = false;
|
domain->iommu_snoop = false;
|
||||||
dev_dbg(ACRN_DBG_IOMMU, "vm=%d add %x:%x no snoop control!", domain->vm_id, bus, devfun);
|
dev_dbg(ACRN_DBG_IOMMU, "vm=%d add %x:%x no snoop control!", domain->vm_id, bus, devfun);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user