From ed132ef8aea6a8202cf4ee96a542b3d7be72b5d9 Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Wed, 26 May 2021 18:14:01 +0100 Subject: ArmPkg: Fix Non-Boolean comparison in ArmGicEnableDistributor According to edk2 coding standard specification, Non-Boolean comparisons must use a compare operator (==, !=, >, < >=, <=). See Section 5.7.2.1 at https://edk2-docs.gitbook.io/ edk-ii-c-coding-standards-specification/5_source_files/ 57_c_programming Therefore, fix the comparison in ArmGicEnableDistributor() Signed-off-by: Sami Mujawar --- ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ArmPkg') diff --git a/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c b/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c index 38bbf2e9f8..1a6ad48d1f 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c @@ -17,6 +17,7 @@ ArmGicEnableDistributor ( ) { ARM_GIC_ARCH_REVISION Revision; + UINT32 GicDistributorCtl; /* * Enable GIC distributor in Non-Secure world. @@ -26,7 +27,8 @@ ArmGicEnableDistributor ( if (Revision == ARM_GIC_ARCH_REVISION_2) { MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1); } else { - if (MmioRead32 (GicDistributorBase + ARM_GIC_ICDDCR) & ARM_GIC_ICDDCR_ARE) { + GicDistributorCtl = MmioRead32 (GicDistributorBase + ARM_GIC_ICDDCR); + if ((GicDistributorCtl & ARM_GIC_ICDDCR_ARE) != 0) { MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x2); } else { MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1); -- cgit v1.2.3