summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2020-12-10 13:10:42 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-01-06 16:22:54 +0000
commitb9b86dc4f60a0010b4a3f12b97f8357269b6bfa2 (patch)
treea86335a319380cf0ec79ef89c1bd51a72021e7f0
parent15f5b04e435197318257269ff2b1ee8c212528ef (diff)
downloadedk2-b9b86dc4f60a0010b4a3f12b97f8357269b6bfa2.tar.gz
edk2-b9b86dc4f60a0010b4a3f12b97f8357269b6bfa2.tar.bz2
edk2-b9b86dc4f60a0010b4a3f12b97f8357269b6bfa2.zip
ArmPkg: Fix Ecc error 5007 in ArmDisassemblerLib
This patch fixes the following Ecc reported error: There should be no initialization of a variable as part of its declaration Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
-rw-r--r--ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c b/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c
index abaacca53a..e67e13a50a 100644
--- a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c
+++ b/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c
@@ -158,7 +158,7 @@ DisassembleArmInstruction (
IN BOOLEAN Extended
)
{
- UINT32 OpCode = **OpCodePtr;
+ UINT32 OpCode;
CHAR8 *Type, *Root;
BOOLEAN I, P, U, B, W, L, S, H;
UINT32 Rn, Rd, Rm;
@@ -166,6 +166,8 @@ DisassembleArmInstruction (
UINT32 Index;
UINT32 shift_imm, shift;
+ OpCode = **OpCodePtr;
+
I = (OpCode & BIT25) == BIT25;
P = (OpCode & BIT24) == BIT24;
U = (OpCode & BIT23) == BIT23;