diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:53:50 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 429309e0c6b74792d679681a8edd0d5ae0ff850c (patch) | |
tree | 9d26d88024790b459c60a44e14500b7c7076f0d1 /ArmPkg/Library/SemiHostingSerialPortLib | |
parent | 7c2a6033c149625482a18cd51b65513c8fb8fe15 (diff) | |
download | edk2-429309e0c6b74792d679681a8edd0d5ae0ff850c.tar.gz edk2-429309e0c6b74792d679681a8edd0d5ae0ff850c.tar.bz2 edk2-429309e0c6b74792d679681a8edd0d5ae0ff850c.zip |
ArmPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the ArmPkg package
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Andrew Fish <afish@apple.com>
Diffstat (limited to 'ArmPkg/Library/SemiHostingSerialPortLib')
-rw-r--r-- | ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c | 63 |
1 files changed, 27 insertions, 36 deletions
diff --git a/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c b/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c index b6a07dd466..5ff8a5b7a6 100644 --- a/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c +++ b/ArmPkg/Library/SemiHostingSerialPortLib/SerialPortLib.c @@ -13,7 +13,6 @@ #include <Library/SemihostLib.h>
#include <Library/SerialPortLib.h>
-
/*
Programmed hardware of Serial port.
@@ -51,55 +50,50 @@ SerialPortInitialize ( UINTN
EFIAPI
SerialPortWrite (
- IN UINT8 *Buffer,
- IN UINTN NumberOfBytes
-)
+ IN UINT8 *Buffer,
+ IN UINTN NumberOfBytes
+ )
{
- UINT8 PrintBuffer[PRINT_BUFFER_SIZE];
- UINTN SourceIndex;
- UINTN DestinationIndex;
- UINT8 CurrentCharacter;
+ UINT8 PrintBuffer[PRINT_BUFFER_SIZE];
+ UINTN SourceIndex;
+ UINTN DestinationIndex;
+ UINT8 CurrentCharacter;
SourceIndex = 0;
DestinationIndex = 0;
- while (SourceIndex < NumberOfBytes)
- {
- CurrentCharacter = Buffer[SourceIndex++];
+ while (SourceIndex < NumberOfBytes) {
+ CurrentCharacter = Buffer[SourceIndex++];
- switch (CurrentCharacter)
- {
+ switch (CurrentCharacter) {
case '\r':
- continue;
+ continue;
case '\n':
- PrintBuffer[DestinationIndex++] = ' ';
- // fall through
+ PrintBuffer[DestinationIndex++] = ' ';
+ // fall through
default:
- PrintBuffer[DestinationIndex++] = CurrentCharacter;
- break;
- }
+ PrintBuffer[DestinationIndex++] = CurrentCharacter;
+ break;
+ }
- if (DestinationIndex > PRINT_BUFFER_THRESHOLD)
- {
- PrintBuffer[DestinationIndex] = '\0';
- SemihostWriteString ((CHAR8 *) PrintBuffer);
+ if (DestinationIndex > PRINT_BUFFER_THRESHOLD) {
+ PrintBuffer[DestinationIndex] = '\0';
+ SemihostWriteString ((CHAR8 *)PrintBuffer);
- DestinationIndex = 0;
- }
+ DestinationIndex = 0;
+ }
}
- if (DestinationIndex > 0)
- {
- PrintBuffer[DestinationIndex] = '\0';
- SemihostWriteString ((CHAR8 *) PrintBuffer);
+ if (DestinationIndex > 0) {
+ PrintBuffer[DestinationIndex] = '\0';
+ SemihostWriteString ((CHAR8 *)PrintBuffer);
}
return NumberOfBytes;
}
-
/**
Read data from serial device and save the datas in buffer.
@@ -113,16 +107,14 @@ SerialPortWrite ( UINTN
EFIAPI
SerialPortRead (
- OUT UINT8 *Buffer,
- IN UINTN NumberOfBytes
-)
+ OUT UINT8 *Buffer,
+ IN UINTN NumberOfBytes
+ )
{
*Buffer = SemihostReadCharacter ();
return 1;
}
-
-
/**
Check to see if any data is available to be read from the debug device.
@@ -139,4 +131,3 @@ SerialPortPoll ( // Since SemiHosting read character is blocking always say we have a char ready?
return SemihostConnectionSupported ();
}
-
|