From 897ffa273979b459f44da1442e5d9f7e0aab2026 Mon Sep 17 00:00:00 2001 From: Tw Date: Thu, 20 Dec 2018 09:42:45 +0800 Subject: [PATCH] hv:vtd: fix MISRA-C violations on logical conjunctions need brackets This patch fix MISRA-C violations in arch/x86/vtd.c on logical conjunctions need brackets. Tracked-On: #861 Signed-off-by: Tw Acked-by: Anthony Xu --- hypervisor/arch/x86/vtd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c index e91af43f0..47c670c1a 100644 --- a/hypervisor/arch/x86/vtd.c +++ b/hypervisor/arch/x86/vtd.c @@ -145,7 +145,7 @@ bool iommu_snoop_supported(const struct acrn_vm *vm) { bool ret; - if (vm->iommu == NULL || vm->iommu->iommu_snoop) { + if ((vm->iommu == NULL) || (vm->iommu->iommu_snoop)) { ret = true; } else { ret = false; @@ -175,7 +175,7 @@ static int32_t register_hrhd_units(void) uint32_t i; int32_t ret = 0; - if (info == NULL || info->drhd_count == 0U) { + if ((info == NULL) || (info->drhd_count == 0U)) { pr_fatal("%s: can't find dmar info\n", __func__); return -ENODEV; }