summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Library/BasePciCapPciSegmentLib
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:09 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commitac0a286f4d747a4c6c603a7b225917293cbe1e9f (patch)
tree32654f2b35755afc961e2c97296b2dec5762da75 /OvmfPkg/Library/BasePciCapPciSegmentLib
parentd1050b9dff1cace252aff86630bfdb59dff5f507 (diff)
downloadedk2-ac0a286f4d747a4c6c603a7b225917293cbe1e9f.tar.gz
edk2-ac0a286f4d747a4c6c603a7b225917293cbe1e9f.tar.bz2
edk2-ac0a286f4d747a4c6c603a7b225917293cbe1e9f.zip
OvmfPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the OvmfPkg 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 'OvmfPkg/Library/BasePciCapPciSegmentLib')
-rw-r--r--OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.c78
-rw-r--r--OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h16
2 files changed, 50 insertions, 44 deletions
diff --git a/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.c b/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.c
index 81f2a3eb06..8e7ea583fa 100644
--- a/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.c
+++ b/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.c
@@ -14,7 +14,6 @@
#include "BasePciCapPciSegmentLib.h"
-
/**
Read the config space of a given PCI device (both normal and extended).
@@ -44,17 +43,17 @@ STATIC
RETURN_STATUS
EFIAPI
SegmentDevReadConfig (
- IN PCI_CAP_DEV *PciDevice,
- IN UINT16 SourceOffset,
- OUT VOID *DestinationBuffer,
- IN UINT16 Size
+ IN PCI_CAP_DEV *PciDevice,
+ IN UINT16 SourceOffset,
+ OUT VOID *DestinationBuffer,
+ IN UINT16 Size
)
{
- SEGMENT_DEV *SegmentDev;
- UINT16 ConfigSpaceSize;
- UINT64 SourceAddress;
+ SEGMENT_DEV *SegmentDev;
+ UINT16 ConfigSpaceSize;
+ UINT64 SourceAddress;
- SegmentDev = SEGMENT_DEV_FROM_PCI_CAP_DEV (PciDevice);
+ SegmentDev = SEGMENT_DEV_FROM_PCI_CAP_DEV (PciDevice);
ConfigSpaceSize = (SegmentDev->MaxDomain == PciCapNormal ?
PCI_MAX_CONFIG_OFFSET : PCI_EXP_MAX_CONFIG_OFFSET);
//
@@ -64,14 +63,18 @@ SegmentDevReadConfig (
if (SourceOffset + Size > ConfigSpaceSize) {
return RETURN_UNSUPPORTED;
}
- SourceAddress = PCI_SEGMENT_LIB_ADDRESS (SegmentDev->SegmentNr,
- SegmentDev->BusNr, SegmentDev->DeviceNr,
- SegmentDev->FunctionNr, SourceOffset);
+
+ SourceAddress = PCI_SEGMENT_LIB_ADDRESS (
+ SegmentDev->SegmentNr,
+ SegmentDev->BusNr,
+ SegmentDev->DeviceNr,
+ SegmentDev->FunctionNr,
+ SourceOffset
+ );
PciSegmentReadBuffer (SourceAddress, Size, DestinationBuffer);
return RETURN_SUCCESS;
}
-
/**
Write the config space of a given PCI device (both normal and extended).
@@ -101,17 +104,17 @@ STATIC
RETURN_STATUS
EFIAPI
SegmentDevWriteConfig (
- IN PCI_CAP_DEV *PciDevice,
- IN UINT16 DestinationOffset,
- IN VOID *SourceBuffer,
- IN UINT16 Size
+ IN PCI_CAP_DEV *PciDevice,
+ IN UINT16 DestinationOffset,
+ IN VOID *SourceBuffer,
+ IN UINT16 Size
)
{
- SEGMENT_DEV *SegmentDev;
- UINT16 ConfigSpaceSize;
- UINT64 DestinationAddress;
+ SEGMENT_DEV *SegmentDev;
+ UINT16 ConfigSpaceSize;
+ UINT64 DestinationAddress;
- SegmentDev = SEGMENT_DEV_FROM_PCI_CAP_DEV (PciDevice);
+ SegmentDev = SEGMENT_DEV_FROM_PCI_CAP_DEV (PciDevice);
ConfigSpaceSize = (SegmentDev->MaxDomain == PciCapNormal ?
PCI_MAX_CONFIG_OFFSET : PCI_EXP_MAX_CONFIG_OFFSET);
//
@@ -121,14 +124,18 @@ SegmentDevWriteConfig (
if (DestinationOffset + Size > ConfigSpaceSize) {
return RETURN_UNSUPPORTED;
}
- DestinationAddress = PCI_SEGMENT_LIB_ADDRESS (SegmentDev->SegmentNr,
- SegmentDev->BusNr, SegmentDev->DeviceNr,
- SegmentDev->FunctionNr, DestinationOffset);
+
+ DestinationAddress = PCI_SEGMENT_LIB_ADDRESS (
+ SegmentDev->SegmentNr,
+ SegmentDev->BusNr,
+ SegmentDev->DeviceNr,
+ SegmentDev->FunctionNr,
+ DestinationOffset
+ );
PciSegmentWriteBuffer (DestinationAddress, Size, SourceBuffer);
return RETURN_SUCCESS;
}
-
/**
Create a PCI_CAP_DEV object from the PCI Segment:Bus:Device.Function
quadruplet. The config space accessors are based upon PciSegmentLib.
@@ -168,17 +175,17 @@ SegmentDevWriteConfig (
RETURN_STATUS
EFIAPI
PciCapPciSegmentDeviceInit (
- IN PCI_CAP_DOMAIN MaxDomain,
- IN UINT16 Segment,
- IN UINT8 Bus,
- IN UINT8 Device,
- IN UINT8 Function,
- OUT PCI_CAP_DEV **PciDevice
+ IN PCI_CAP_DOMAIN MaxDomain,
+ IN UINT16 Segment,
+ IN UINT8 Bus,
+ IN UINT8 Device,
+ IN UINT8 Function,
+ OUT PCI_CAP_DEV **PciDevice
)
{
- SEGMENT_DEV *SegmentDev;
+ SEGMENT_DEV *SegmentDev;
- if (Device > PCI_MAX_DEVICE || Function > PCI_MAX_FUNC) {
+ if ((Device > PCI_MAX_DEVICE) || (Function > PCI_MAX_FUNC)) {
return RETURN_INVALID_PARAMETER;
}
@@ -200,7 +207,6 @@ PciCapPciSegmentDeviceInit (
return RETURN_SUCCESS;
}
-
/**
Free the resources used by PciDevice.
@@ -210,10 +216,10 @@ PciCapPciSegmentDeviceInit (
VOID
EFIAPI
PciCapPciSegmentDeviceUninit (
- IN PCI_CAP_DEV *PciDevice
+ IN PCI_CAP_DEV *PciDevice
)
{
- SEGMENT_DEV *SegmentDev;
+ SEGMENT_DEV *SegmentDev;
SegmentDev = SEGMENT_DEV_FROM_PCI_CAP_DEV (PciDevice);
FreePool (SegmentDev);
diff --git a/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h b/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h
index a806bf320d..5d587ceca3 100644
--- a/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h
+++ b/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h
@@ -14,25 +14,25 @@
#include <Library/PciCapPciSegmentLib.h>
-#define SEGMENT_DEV_SIG SIGNATURE_64 ('P', 'C', 'P', 'S', 'G', 'M', 'N', 'T')
+#define SEGMENT_DEV_SIG SIGNATURE_64 ('P', 'C', 'P', 'S', 'G', 'M', 'N', 'T')
typedef struct {
//
// Signature identifying the derived class.
//
- UINT64 Signature;
+ UINT64 Signature;
//
// Members added by the derived class, specific to the use of PciSegmentLib.
//
- PCI_CAP_DOMAIN MaxDomain;
- UINT16 SegmentNr;
- UINT8 BusNr;
- UINT8 DeviceNr;
- UINT8 FunctionNr;
+ PCI_CAP_DOMAIN MaxDomain;
+ UINT16 SegmentNr;
+ UINT8 BusNr;
+ UINT8 DeviceNr;
+ UINT8 FunctionNr;
//
// Base class.
//
- PCI_CAP_DEV BaseDevice;
+ PCI_CAP_DEV BaseDevice;
} SEGMENT_DEV;
#define SEGMENT_DEV_FROM_PCI_CAP_DEV(PciDevice) \