]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Fix Ecc error 3002 in CpuDxe
authorPierre Gondois <Pierre.Gondois@arm.com>
Thu, 10 Dec 2020 16:50:22 +0000 (16:50 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 6 Jan 2021 16:22:54 +0000 (16:22 +0000)
This patch fixes the following Ecc reported error:
Non-Boolean comparisons should use a compare operator
(==, !=, >, < >=, <=)

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
ArmPkg/Drivers/CpuDxe/Arm/Mmu.c

index fca2d4f7638a0d3c355a2a35dfb90f772b8785ad..4b6bc47e51850a345f8f0198f251d5bfb6b78e87 100644 (file)
@@ -2,7 +2,7 @@
 \r
 Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>\r
 Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
-Portions copyright (c) 2011-2013, ARM Ltd. All rights reserved.<BR>\r
+Portions copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>\r
 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
@@ -282,12 +282,12 @@ EfiAttributeToArmAttribute (
   ArmAttributes |= TT_AF;\r
 \r
   // Determine protection attributes\r
-  if (EfiAttributes & EFI_MEMORY_RO) {\r
+  if ((EfiAttributes & EFI_MEMORY_RO) != 0) {\r
     ArmAttributes |= TT_AP_RO_RO;\r
   }\r
 \r
   // Process eXecute Never attribute\r
-  if (EfiAttributes & EFI_MEMORY_XP) {\r
+  if ((EfiAttributes & EFI_MEMORY_XP) != 0) {\r
     ArmAttributes |= TT_PXN_MASK;\r
   }\r
 \r
index 6fb5112a1a8e26f3d8c3ea9634209a3336280459..2a668f078811b11817eefcb62086602f165b547d 100644 (file)
@@ -2,7 +2,7 @@
 \r
 Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>\r
 Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
-Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>\r
+Portions copyright (c) 2013-2021, Arm Limited. All rights reserved.<BR>\r
 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
@@ -366,14 +366,14 @@ EfiAttributeToArmAttribute (
   }\r
 \r
   // Determine protection attributes\r
-  if (EfiAttributes & EFI_MEMORY_RO) {\r
+  if ((EfiAttributes & EFI_MEMORY_RO) != 0) {\r
     ArmAttributes |= TT_DESCRIPTOR_SECTION_AP_RO_RO;\r
   } else {\r
     ArmAttributes |= TT_DESCRIPTOR_SECTION_AP_RW_RW;\r
   }\r
 \r
   // Determine eXecute Never attribute\r
-  if (EfiAttributes & EFI_MEMORY_XP) {\r
+  if ((EfiAttributes & EFI_MEMORY_XP) != 0) {\r
     ArmAttributes |= TT_DESCRIPTOR_SECTION_XN_MASK;\r
   }\r
 \r