summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Mujawar <sami.mujawar@arm.com>2021-05-26 18:14:01 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-06-01 15:52:01 +0000
commited132ef8aea6a8202cf4ee96a542b3d7be72b5d9 (patch)
tree5eb2189392b964cd3c4d7e4c6de02d31fe8c08ac
parentea522a12b35852728a5fdbaa484bdb7425402f5b (diff)
downloadedk2-ed132ef8aea6a8202cf4ee96a542b3d7be72b5d9.tar.gz
edk2-ed132ef8aea6a8202cf4ee96a542b3d7be72b5d9.tar.bz2
edk2-ed132ef8aea6a8202cf4ee96a542b3d7be72b5d9.zip
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 <sami.mujawar@arm.com>
-rw-r--r--ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c4
1 files changed, 3 insertions, 1 deletions
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);