]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Fix Ecc error 5007 in SemiHostingSerialPortLib
authorPierre Gondois <Pierre.Gondois@arm.com>
Thu, 10 Dec 2020 13:13:23 +0000 (13:13 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 6 Jan 2021 16:22:54 +0000 (16:22 +0000)
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>
ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c

index 7e5c61fad4bdbdd658f76f005c12ac983c76d427..e35bcee38098fcd5115e61d2f8d63fc39704a9c1 100644 (file)
@@ -2,6 +2,7 @@
   Serial I/O Port library functions with no library constructor/destructor\r
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+  Copyright (c) 2021, Arm Limited. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -55,10 +56,13 @@ SerialPortWrite (
 )\r
 {\r
   UINT8 PrintBuffer[PRINT_BUFFER_SIZE];\r
-  UINTN SourceIndex      = 0;\r
-  UINTN DestinationIndex = 0;\r
+  UINTN SourceIndex;\r
+  UINTN DestinationIndex;\r
   UINT8 CurrentCharacter;\r
 \r
+  SourceIndex      = 0;\r
+  DestinationIndex = 0;\r
+\r
   while (SourceIndex < NumberOfBytes)\r
   {\r
       CurrentCharacter = Buffer[SourceIndex++];\r