]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/arm/virt: Simplify logic for setting instance's 'tcg_its' variable
authorGustavo Romero <gustavo.romero@linaro.org>
Tue, 1 Jul 2025 14:08:29 +0000 (15:08 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 1 Jul 2025 14:08:29 +0000 (15:08 +0100)
Because 'tcg_its' in the machine instance is set based on the machine
class’s negated variable 'no_tcg_its', 'tcg_its' is the opposite of
'no_tcg_its' and hence the code in question can be simplified as:
tcg_its = !no_tcg_its.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20250628195722.977078-3-gustavo.romero@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/virt.c

index 99fde5836c94579f9096566600318d4642349ad3..6d9256a52555fccc73c415324dea9de9b2a12214 100644 (file)
@@ -3342,12 +3342,8 @@ static void virt_instance_init(Object *obj)
 
     /* Default allows ITS instantiation */
     vms->its = true;
-
-    if (vmc->no_tcg_its) {
-        vms->tcg_its = false;
-    } else {
-        vms->tcg_its = true;
-    }
+    /* Allow ITS emulation if the machine version supports it */
+    vms->tcg_its = !vmc->no_tcg_its;
 
     /* Default disallows iommu instantiation */
     vms->iommu = VIRT_IOMMU_NONE;