X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ArmPkg%2FLibrary%2FSemiHostingSerialPortLib%2FSerialPortLib.c;h=b6a07dd46608f49a15224df7532fd16ad92faded;hb=b8de64bedecf01b5df760d9f81bdd9c0d733399e;hp=7e5c61fad4bdbdd658f76f005c12ac983c76d427;hpb=ff5fef1428dafc8f73e1f5d63966ef5c9bd8c420;p=mirror_edk2.git diff --git a/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c b/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c index 7e5c61fad4..b6a07dd466 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 @@ -36,11 +37,11 @@ SerialPortInitialize ( /** Write data to serial device. - @param Buffer Point of data buffer which need to be writed. + @param Buffer Point of data buffer which need to be written. @param NumberOfBytes Number of output bytes which are cached in Buffer. @retval 0 Write data failed. - @retval !0 Actual number of bytes writed to serial device. + @retval !0 Actual number of bytes written to serial device. **/ @@ -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++]; @@ -99,7 +103,7 @@ SerialPortWrite ( /** Read data from serial device and save the datas in buffer. - @param Buffer Point of data buffer which need to be writed. + @param Buffer Point of data buffer which need to be written. @param NumberOfBytes Number of output bytes which are cached in Buffer. @retval 0 Read data failed.