summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2020-12-10 13:13:23 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-01-06 16:22:54 +0000
commit02c621f3f7a3131e6c7a4bab6a507546632959d7 (patch)
treea436ca37c453778abea3328cdaacf2913e66a8fb /ArmPkg
parent146af6a45b4eb5c0a0dcd1239a7b28599a79db5c (diff)
downloadedk2-02c621f3f7a3131e6c7a4bab6a507546632959d7.tar.gz
edk2-02c621f3f7a3131e6c7a4bab6a507546632959d7.tar.bz2
edk2-02c621f3f7a3131e6c7a4bab6a507546632959d7.zip
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 <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c8
1 files 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.<BR>
+ Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
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++];