[edk2-devel] [PATCH v1 22/25] ArmPkg: Fix Ecc error 5007 in SemiHostingSerialPortLib
PierreGondois
pierre.gondois at arm.com
Wed Dec 16 17:21:57 UTC 2020
From: Pierre Gondois <Pierre.Gondois at arm.com>
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 at arm.com>
---
The changes can be seen at: https://github.com/PierreARM/edk2/commits/1552_Ecc_ArmPkg_v1
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 7e5c61fad4bd..2973d107a323 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) 2020, 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++];
--
2.17.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69005): https://edk2.groups.io/g/devel/message/69005
Mute This Topic: https://groups.io/mt/79006212/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list