]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c
ArmPkg: Correct small typos
[mirror_edk2.git] / ArmPkg / Library / SemiHostingSerialPortLib / SerialPortLib.c
index 7e5c61fad4bdbdd658f76f005c12ac983c76d427..b6a07dd46608f49a15224df7532fd16ad92faded 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
@@ -36,11 +37,11 @@ SerialPortInitialize (
 /**\r
   Write data to serial device.\r
 \r
-  @param  Buffer           Point of data buffer which need to be writed.\r
+  @param  Buffer           Point of data buffer which need to be written.\r
   @param  NumberOfBytes    Number of output bytes which are cached in Buffer.\r
 \r
   @retval 0                Write data failed.\r
-  @retval !0               Actual number of bytes writed to serial device.\r
+  @retval !0               Actual number of bytes written to serial device.\r
 \r
 **/\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
@@ -99,7 +103,7 @@ SerialPortWrite (
 /**\r
   Read data from serial device and save the datas in buffer.\r
 \r
-  @param  Buffer           Point of data buffer which need to be writed.\r
+  @param  Buffer           Point of data buffer which need to be written.\r
   @param  NumberOfBytes    Number of output bytes which are cached in Buffer.\r
 \r
   @retval 0                Read data failed.\r