]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_domain_address: Drop needless virDomainIOMMUModel typecast
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 4 Jul 2022 09:09:46 +0000 (11:09 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 4 Jul 2022 11:21:16 +0000 (13:21 +0200)
There are two places where the @model member of
_virDomainIOMMUDef struct is typecasted to virDomainIOMMUModel
which is completely unnecessary because the struct already
defines the member of that type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain_address.c

index 753733d1b95859cac8aef9ab1e44f7f839a3a66f..026be99ba9080ed9e9968c30dbc38fcf2935ec3f 100644 (file)
@@ -1003,7 +1003,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev,
         break;
 
     case VIR_DOMAIN_DEVICE_IOMMU:
-        switch ((virDomainIOMMUModel) dev->data.iommu->model) {
+        switch (dev->data.iommu->model) {
             case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
                 return virtioFlags | VIR_PCI_CONNECT_INTEGRATED;
 
@@ -2384,7 +2384,7 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def,
     if (def->iommu) {
         virDomainIOMMUDef *iommu = def->iommu;
 
-        switch ((virDomainIOMMUModel) iommu->model) {
+        switch (iommu->model) {
         case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
             if (virDeviceInfoPCIAddressIsWanted(&iommu->info) &&
                 qemuDomainPCIAddressReserveNextAddr(addrs, &iommu->info) < 0) {