]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c
ArmPkg: Apply uncrustify changes
[mirror_edk2.git] / ArmPkg / Library / SemiHostingSerialPortLib / SerialPortLib.c
index b6a07dd46608f49a15224df7532fd16ad92faded..5ff8a5b7a62e1e0291d6247dce8c87947e0a53be 100644 (file)
@@ -13,7 +13,6 @@
 #include <Library/SemihostLib.h>\r
 #include <Library/SerialPortLib.h>\r
 \r
-\r
 /*\r
 \r
   Programmed hardware of Serial port.\r
@@ -51,55 +50,50 @@ SerialPortInitialize (
 UINTN\r
 EFIAPI\r
 SerialPortWrite (\r
-  IN UINT8     *Buffer,\r
-  IN UINTN     NumberOfBytes\r
-)\r
+  IN UINT8  *Buffer,\r
+  IN UINTN  NumberOfBytes\r
+  )\r
 {\r
-  UINT8 PrintBuffer[PRINT_BUFFER_SIZE];\r
-  UINTN SourceIndex;\r
-  UINTN DestinationIndex;\r
-  UINT8 CurrentCharacter;\r
+  UINT8  PrintBuffer[PRINT_BUFFER_SIZE];\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
+  while (SourceIndex < NumberOfBytes) {\r
+    CurrentCharacter = Buffer[SourceIndex++];\r
 \r
-      switch (CurrentCharacter)\r
-      {\r
+    switch (CurrentCharacter) {\r
       case '\r':\r
-          continue;\r
+        continue;\r
 \r
       case '\n':\r
-          PrintBuffer[DestinationIndex++] = ' ';\r
-          // fall through\r
+        PrintBuffer[DestinationIndex++] = ' ';\r
+      // fall through\r
 \r
       default:\r
-          PrintBuffer[DestinationIndex++] = CurrentCharacter;\r
-          break;\r
-      }\r
+        PrintBuffer[DestinationIndex++] = CurrentCharacter;\r
+        break;\r
+    }\r
 \r
-      if (DestinationIndex > PRINT_BUFFER_THRESHOLD)\r
-      {\r
-          PrintBuffer[DestinationIndex] = '\0';\r
-          SemihostWriteString ((CHAR8 *) PrintBuffer);\r
+    if (DestinationIndex > PRINT_BUFFER_THRESHOLD) {\r
+      PrintBuffer[DestinationIndex] = '\0';\r
+      SemihostWriteString ((CHAR8 *)PrintBuffer);\r
 \r
-          DestinationIndex = 0;\r
-      }\r
+      DestinationIndex = 0;\r
+    }\r
   }\r
 \r
-  if (DestinationIndex > 0)\r
-  {\r
-      PrintBuffer[DestinationIndex] = '\0';\r
-      SemihostWriteString ((CHAR8 *) PrintBuffer);\r
+  if (DestinationIndex > 0) {\r
+    PrintBuffer[DestinationIndex] = '\0';\r
+    SemihostWriteString ((CHAR8 *)PrintBuffer);\r
   }\r
 \r
   return NumberOfBytes;\r
 }\r
 \r
-\r
 /**\r
   Read data from serial device and save the datas in buffer.\r
 \r
@@ -113,16 +107,14 @@ SerialPortWrite (
 UINTN\r
 EFIAPI\r
 SerialPortRead (\r
-  OUT UINT8     *Buffer,\r
-  IN  UINTN     NumberOfBytes\r
-)\r
+  OUT UINT8  *Buffer,\r
+  IN  UINTN  NumberOfBytes\r
+  )\r
 {\r
   *Buffer = SemihostReadCharacter ();\r
   return 1;\r
 }\r
 \r
-\r
-\r
 /**\r
   Check to see if any data is available to be read from the debug device.\r
 \r
@@ -139,4 +131,3 @@ SerialPortPoll (
   // Since SemiHosting read character is blocking always say we have a char ready?\r
   return SemihostConnectionSupported ();\r
 }\r
-\r