From 02c621f3f7a3131e6c7a4bab6a507546632959d7 Mon Sep 17 00:00:00 2001 From: Pierre Gondois Date: Thu, 10 Dec 2020 13:13:23 +0000 Subject: [PATCH] ArmPkg: Fix Ecc error 5007 in SemiHostingSerialPortLib 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 Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c b/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c index 7e5c61fad4..e35bcee380 100644 --- a/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c +++ b/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c @@ -2,6 +2,7 @@ Serial I/O Port library functions with no library constructor/destructor Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+ Copyright (c) 2021, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -55,10 +56,13 @@ SerialPortWrite ( ) { UINT8 PrintBuffer[PRINT_BUFFER_SIZE]; - UINTN SourceIndex = 0; - UINTN DestinationIndex = 0; + UINTN SourceIndex; + UINTN DestinationIndex; UINT8 CurrentCharacter; + SourceIndex = 0; + DestinationIndex = 0; + while (SourceIndex < NumberOfBytes) { CurrentCharacter = Buffer[SourceIndex++]; -- 2.39.2