diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:05 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 2f88bd3a1296c522317f1c21377876de63de5be7 (patch) | |
tree | ba47875489cc5698061275a495983e9dea3be098 /MdePkg/Library/UefiPciLibPciRootBridgeIo | |
parent | 1436aea4d5707e672672a11bda72be2c63c936c3 (diff) | |
download | edk2-2f88bd3a1296c522317f1c21377876de63de5be7.tar.gz edk2-2f88bd3a1296c522317f1c21377876de63de5be7.tar.bz2 edk2-2f88bd3a1296c522317f1c21377876de63de5be7.zip |
MdePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the MdePkg 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: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdePkg/Library/UefiPciLibPciRootBridgeIo')
-rw-r--r-- | MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c | 268 |
1 files changed, 134 insertions, 134 deletions
diff --git a/MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c b/MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c index 57eb37c3e0..f4e9882eba 100644 --- a/MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c +++ b/MdePkg/Library/UefiPciLibPciRootBridgeIo/PciLib.c @@ -21,7 +21,7 @@ @param M Additional bits to assert to be zero.
**/
-#define ASSERT_INVALID_PCI_ADDRESS(A,M) \
+#define ASSERT_INVALID_PCI_ADDRESS(A, M) \
ASSERT (((A) & (~0xfffffff | (M))) == 0)
/**
@@ -37,7 +37,7 @@ //
// Global varible to cache pointer to PCI Root Bridge I/O protocol.
//
-EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *mPciRootBridgeIo = NULL;
+EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *mPciRootBridgeIo = NULL;
/**
The constructor function caches the pointer to PCI Root Bridge I/O protocol.
@@ -54,13 +54,13 @@ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *mPciRootBridgeIo = NULL; EFI_STATUS
EFIAPI
PciLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
- Status = gBS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**) &mPciRootBridgeIo);
+ Status = gBS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID **)&mPciRootBridgeIo);
ASSERT_EFI_ERROR (Status);
ASSERT (mPciRootBridgeIo != NULL);
@@ -182,12 +182,12 @@ PciRegisterForRuntimeAccess ( UINT8
EFIAPI
PciRead8 (
- IN UINTN Address
+ IN UINTN Address
)
{
ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- return (UINT8) DxePciLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint8);
+ return (UINT8)DxePciLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint8);
}
/**
@@ -209,13 +209,13 @@ PciRead8 ( UINT8
EFIAPI
PciWrite8 (
- IN UINTN Address,
- IN UINT8 Value
+ IN UINTN Address,
+ IN UINT8 Value
)
{
ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- return (UINT8) DxePciLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint8, Value);
+ return (UINT8)DxePciLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint8, Value);
}
/**
@@ -241,11 +241,11 @@ PciWrite8 ( UINT8
EFIAPI
PciOr8 (
- IN UINTN Address,
- IN UINT8 OrData
+ IN UINTN Address,
+ IN UINT8 OrData
)
{
- return PciWrite8 (Address, (UINT8) (PciRead8 (Address) | OrData));
+ return PciWrite8 (Address, (UINT8)(PciRead8 (Address) | OrData));
}
/**
@@ -271,11 +271,11 @@ PciOr8 ( UINT8
EFIAPI
PciAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
+ IN UINTN Address,
+ IN UINT8 AndData
)
{
- return PciWrite8 (Address, (UINT8) (PciRead8 (Address) & AndData));
+ return PciWrite8 (Address, (UINT8)(PciRead8 (Address) & AndData));
}
/**
@@ -303,12 +303,12 @@ PciAnd8 ( UINT8
EFIAPI
PciAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
+ IN UINTN Address,
+ IN UINT8 AndData,
+ IN UINT8 OrData
)
{
- return PciWrite8 (Address, (UINT8) ((PciRead8 (Address) & AndData) | OrData));
+ return PciWrite8 (Address, (UINT8)((PciRead8 (Address) & AndData) | OrData));
}
/**
@@ -335,9 +335,9 @@ PciAndThenOr8 ( UINT8
EFIAPI
PciBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit
)
{
return BitFieldRead8 (PciRead8 (Address), StartBit, EndBit);
@@ -370,10 +370,10 @@ PciBitFieldRead8 ( UINT8
EFIAPI
PciBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT8 Value
)
{
return PciWrite8 (
@@ -412,10 +412,10 @@ PciBitFieldWrite8 ( UINT8
EFIAPI
PciBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT8 OrData
)
{
return PciWrite8 (
@@ -454,10 +454,10 @@ PciBitFieldOr8 ( UINT8
EFIAPI
PciBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT8 AndData
)
{
return PciWrite8 (
@@ -500,11 +500,11 @@ PciBitFieldAnd8 ( UINT8
EFIAPI
PciBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT8 AndData,
+ IN UINT8 OrData
)
{
return PciWrite8 (
@@ -532,12 +532,12 @@ PciBitFieldAndThenOr8 ( UINT16
EFIAPI
PciRead16 (
- IN UINTN Address
+ IN UINTN Address
)
{
ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- return (UINT16) DxePciLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint16);
+ return (UINT16)DxePciLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint16);
}
/**
@@ -560,13 +560,13 @@ PciRead16 ( UINT16
EFIAPI
PciWrite16 (
- IN UINTN Address,
- IN UINT16 Value
+ IN UINTN Address,
+ IN UINT16 Value
)
{
ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- return (UINT16) DxePciLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint16, Value);
+ return (UINT16)DxePciLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint16, Value);
}
/**
@@ -593,11 +593,11 @@ PciWrite16 ( UINT16
EFIAPI
PciOr16 (
- IN UINTN Address,
- IN UINT16 OrData
+ IN UINTN Address,
+ IN UINT16 OrData
)
{
- return PciWrite16 (Address, (UINT16) (PciRead16 (Address) | OrData));
+ return PciWrite16 (Address, (UINT16)(PciRead16 (Address) | OrData));
}
/**
@@ -624,11 +624,11 @@ PciOr16 ( UINT16
EFIAPI
PciAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
+ IN UINTN Address,
+ IN UINT16 AndData
)
{
- return PciWrite16 (Address, (UINT16) (PciRead16 (Address) & AndData));
+ return PciWrite16 (Address, (UINT16)(PciRead16 (Address) & AndData));
}
/**
@@ -657,12 +657,12 @@ PciAnd16 ( UINT16
EFIAPI
PciAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
+ IN UINTN Address,
+ IN UINT16 AndData,
+ IN UINT16 OrData
)
{
- return PciWrite16 (Address, (UINT16) ((PciRead16 (Address) & AndData) | OrData));
+ return PciWrite16 (Address, (UINT16)((PciRead16 (Address) & AndData) | OrData));
}
/**
@@ -690,9 +690,9 @@ PciAndThenOr16 ( UINT16
EFIAPI
PciBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit
)
{
return BitFieldRead16 (PciRead16 (Address), StartBit, EndBit);
@@ -726,10 +726,10 @@ PciBitFieldRead16 ( UINT16
EFIAPI
PciBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT16 Value
)
{
return PciWrite16 (
@@ -769,10 +769,10 @@ PciBitFieldWrite16 ( UINT16
EFIAPI
PciBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT16 OrData
)
{
return PciWrite16 (
@@ -812,10 +812,10 @@ PciBitFieldOr16 ( UINT16
EFIAPI
PciBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT16 AndData
)
{
return PciWrite16 (
@@ -859,11 +859,11 @@ PciBitFieldAnd16 ( UINT16
EFIAPI
PciBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT16 AndData,
+ IN UINT16 OrData
)
{
return PciWrite16 (
@@ -891,7 +891,7 @@ PciBitFieldAndThenOr16 ( UINT32
EFIAPI
PciRead32 (
- IN UINTN Address
+ IN UINTN Address
)
{
ASSERT_INVALID_PCI_ADDRESS (Address, 3);
@@ -919,8 +919,8 @@ PciRead32 ( UINT32
EFIAPI
PciWrite32 (
- IN UINTN Address,
- IN UINT32 Value
+ IN UINTN Address,
+ IN UINT32 Value
)
{
ASSERT_INVALID_PCI_ADDRESS (Address, 3);
@@ -952,8 +952,8 @@ PciWrite32 ( UINT32
EFIAPI
PciOr32 (
- IN UINTN Address,
- IN UINT32 OrData
+ IN UINTN Address,
+ IN UINT32 OrData
)
{
return PciWrite32 (Address, PciRead32 (Address) | OrData);
@@ -983,8 +983,8 @@ PciOr32 ( UINT32
EFIAPI
PciAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
+ IN UINTN Address,
+ IN UINT32 AndData
)
{
return PciWrite32 (Address, PciRead32 (Address) & AndData);
@@ -1016,9 +1016,9 @@ PciAnd32 ( UINT32
EFIAPI
PciAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
+ IN UINTN Address,
+ IN UINT32 AndData,
+ IN UINT32 OrData
)
{
return PciWrite32 (Address, (PciRead32 (Address) & AndData) | OrData);
@@ -1049,9 +1049,9 @@ PciAndThenOr32 ( UINT32
EFIAPI
PciBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit
)
{
return BitFieldRead32 (PciRead32 (Address), StartBit, EndBit);
@@ -1085,10 +1085,10 @@ PciBitFieldRead32 ( UINT32
EFIAPI
PciBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT32 Value
)
{
return PciWrite32 (
@@ -1128,10 +1128,10 @@ PciBitFieldWrite32 ( UINT32
EFIAPI
PciBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT32 OrData
)
{
return PciWrite32 (
@@ -1171,10 +1171,10 @@ PciBitFieldOr32 ( UINT32
EFIAPI
PciBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT32 AndData
)
{
return PciWrite32 (
@@ -1218,11 +1218,11 @@ PciBitFieldAnd32 ( UINT32
EFIAPI
PciBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
+ IN UINTN Address,
+ IN UINTN StartBit,
+ IN UINTN EndBit,
+ IN UINT32 AndData,
+ IN UINT32 OrData
)
{
return PciWrite32 (
@@ -1257,12 +1257,12 @@ PciBitFieldAndThenOr32 ( UINTN
EFIAPI
PciReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
+ IN UINTN StartAddress,
+ IN UINTN Size,
+ OUT VOID *Buffer
)
{
- UINTN ReturnValue;
+ UINTN ReturnValue;
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
@@ -1283,19 +1283,19 @@ PciReadBuffer ( // Read a byte if StartAddress is byte aligned
//
*(volatile UINT8 *)Buffer = PciRead8 (StartAddress);
- StartAddress += sizeof (UINT8);
- Size -= sizeof (UINT8);
- Buffer = (UINT8*)Buffer + 1;
+ StartAddress += sizeof (UINT8);
+ Size -= sizeof (UINT8);
+ Buffer = (UINT8 *)Buffer + 1;
}
- if (Size >= sizeof (UINT16) && (StartAddress & BIT1) != 0) {
+ if ((Size >= sizeof (UINT16)) && ((StartAddress & BIT1) != 0)) {
//
// Read a word if StartAddress is word aligned
//
WriteUnaligned16 (Buffer, PciRead16 (StartAddress));
StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
+ Size -= sizeof (UINT16);
+ Buffer = (UINT16 *)Buffer + 1;
}
while (Size >= sizeof (UINT32)) {
@@ -1304,8 +1304,8 @@ PciReadBuffer ( //
WriteUnaligned32 (Buffer, PciRead32 (StartAddress));
StartAddress += sizeof (UINT32);
- Size -= sizeof (UINT32);
- Buffer = (UINT32*)Buffer + 1;
+ Size -= sizeof (UINT32);
+ Buffer = (UINT32 *)Buffer + 1;
}
if (Size >= sizeof (UINT16)) {
@@ -1314,8 +1314,8 @@ PciReadBuffer ( //
WriteUnaligned16 (Buffer, PciRead16 (StartAddress));
StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
+ Size -= sizeof (UINT16);
+ Buffer = (UINT16 *)Buffer + 1;
}
if (Size >= sizeof (UINT8)) {
@@ -1355,12 +1355,12 @@ PciReadBuffer ( UINTN
EFIAPI
PciWriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
+ IN UINTN StartAddress,
+ IN UINTN Size,
+ IN VOID *Buffer
)
{
- UINTN ReturnValue;
+ UINTN ReturnValue;
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
@@ -1380,20 +1380,20 @@ PciWriteBuffer ( //
// Write a byte if StartAddress is byte aligned
//
- PciWrite8 (StartAddress, *(UINT8*)Buffer);
+ PciWrite8 (StartAddress, *(UINT8 *)Buffer);
StartAddress += sizeof (UINT8);
- Size -= sizeof (UINT8);
- Buffer = (UINT8*)Buffer + 1;
+ Size -= sizeof (UINT8);
+ Buffer = (UINT8 *)Buffer + 1;
}
- if (Size >= sizeof (UINT16) && (StartAddress & BIT1) != 0) {
+ if ((Size >= sizeof (UINT16)) && ((StartAddress & BIT1) != 0)) {
//
// Write a word if StartAddress is word aligned
//
PciWrite16 (StartAddress, ReadUnaligned16 (Buffer));
StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
+ Size -= sizeof (UINT16);
+ Buffer = (UINT16 *)Buffer + 1;
}
while (Size >= sizeof (UINT32)) {
@@ -1402,8 +1402,8 @@ PciWriteBuffer ( //
PciWrite32 (StartAddress, ReadUnaligned32 (Buffer));
StartAddress += sizeof (UINT32);
- Size -= sizeof (UINT32);
- Buffer = (UINT32*)Buffer + 1;
+ Size -= sizeof (UINT32);
+ Buffer = (UINT32 *)Buffer + 1;
}
if (Size >= sizeof (UINT16)) {
@@ -1412,15 +1412,15 @@ PciWriteBuffer ( //
PciWrite16 (StartAddress, ReadUnaligned16 (Buffer));
StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
+ Size -= sizeof (UINT16);
+ Buffer = (UINT16 *)Buffer + 1;
}
if (Size >= sizeof (UINT8)) {
//
// Write the last remaining byte if exist
//
- PciWrite8 (StartAddress, *(UINT8*)Buffer);
+ PciWrite8 (StartAddress, *(UINT8 *)Buffer);
}
return ReturnValue;
|