From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.54.1608139354948443396 for ; Wed, 16 Dec 2020 09:22:35 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A18AAD6E; Wed, 16 Dec 2020 09:22:34 -0800 (PST) Received: from e120189.arm.com (unknown [10.57.25.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 55DF03F66E; Wed, 16 Dec 2020 09:22:33 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io, ard.biesheuvel@arm.com, leif@nuviainc.com Cc: sami.mujawar@arm.com Subject: [PATCH v1 09/25] ArmPkg: Fix Ecc error 3002 in ArmDisassemblerLib Date: Wed, 16 Dec 2020 17:21:44 +0000 Message-Id: <20201216172200.25846-10-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201216172200.25846-1-Pierre.Gondois@arm.com> References: <20201216172200.25846-1-Pierre.Gondois@arm.com> From: Pierre Gondois This patch fixes the following Ecc reported error: Non-Boolean comparisons should use a compare operator (==, !=, >, < >=, <=) Signed-off-by: Pierre Gondois --- The changes can be seen at: https://github.com/PierreARM/edk2/commits/1552_Ecc_ArmPkg_v1 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 d206cf4ea908..04b6c2cd21e0 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) 2020, 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.17.1