]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Fix Ecc error 3002 in StandaloneMmMmuLib
authorPierre Gondois <Pierre.Gondois@arm.com>
Tue, 20 Apr 2021 13:04:04 +0000 (14:04 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 28 Apr 2021 12:03:51 +0000 (12:03 +0000)
This patch fixes the following Ecc reported error:
Non-Boolean comparisons should use a compare operator
(==, !=, >, < >=, <=)

Cc: Bret Barkelew <bret.barkelew@microsoft.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
ArmPkg/Library/StandaloneMmMmuLib/AArch64/ArmMmuStandaloneMmLib.c

index 5f453d18e4156b1e076f503de7c56ada411aaa25..31672ae5cf4d22a52db885569227530d50a58fb1 100644 (file)
@@ -101,7 +101,7 @@ SendMemoryPermissionRequest (
   }\r
 \r
   // Check error response from Callee.\r
-  if (*RetVal & BIT31) {\r
+  if ((*RetVal & BIT31) != 0) {\r
     // Bit 31 set means there is an error retured\r
     // See [1], Section 13.5.5.1 MM_SP_MEMORY_ATTRIBUTES_GET_AARCH64 and\r
     // Section 13.5.5.2 MM_SP_MEMORY_ATTRIBUTES_SET_AARCH64.\r