From 31ea1d2e071f94216a4db7e2de234b3e2dcc24c2 Mon Sep 17 00:00:00 2001 From: Pierre Gondois Date: Thu, 10 Dec 2020 10:40:51 +0000 Subject: [PATCH] ArmPkg: Fix Ecc error 3002 in ArmDisassemblerLib This patch fixes the following Ecc reported error: Non-Boolean comparisons should use a compare operator (==, !=, >, < >=, <=) Signed-off-by: Pierre Gondois Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c b/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c index d206cf4ea9..abaacca53a 100644 --- a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c +++ b/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c @@ -2,6 +2,7 @@ Default exception handler Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
+ Copyright (c) 2021, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -367,7 +368,11 @@ DisassembleArmInstruction ( AsciiSPrint (Buf, Size, "CPS #0x%x", (OpCode & 0x2f)); } else { imode = (OpCode >> 18) & 0x3; - Index = AsciiSPrint (Buf, Size, "CPS%a %a%a%a", (imode == 3) ? "ID":"IE", (OpCode & BIT8) ? "A":"", (OpCode & BIT7) ? "I":"", (OpCode & BIT6) ? "F":""); + Index = AsciiSPrint (Buf, Size, "CPS%a %a%a%a", + (imode == 3) ? "ID":"IE", + ((OpCode & BIT8) != 0) ? "A":"", + ((OpCode & BIT7) != 0) ? "I":"", + ((OpCode & BIT6) != 0) ? "F":""); if ((OpCode & BIT17) != 0) { AsciiSPrint (&Buf[Index], Size - Index, ", #0x%x", OpCode & 0x1f); } -- 2.39.2