diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:02 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 1436aea4d5707e672672a11bda72be2c63c936c3 (patch) | |
tree | 370c9d5bd8823aa8ea7bce71a0f29bff71feff67 /MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c | |
parent | 7c7184e201a90a1d2376e615e55e3f4074731468 (diff) | |
download | edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.gz edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.bz2 edk2-1436aea4d5707e672672a11bda72be2c63c936c3.zip |
MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the MdeModulePkg 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 'MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c')
-rw-r--r-- | MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c | 114 |
1 files changed, 62 insertions, 52 deletions
diff --git a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c index 8074268986..a68612dd76 100644 --- a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c +++ b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c @@ -34,44 +34,44 @@ GetGuidFromType ( )
{
switch (Type) {
- case NonDiscoverableDeviceTypeAhci:
- return &gEdkiiNonDiscoverableAhciDeviceGuid;
+ case NonDiscoverableDeviceTypeAhci:
+ return &gEdkiiNonDiscoverableAhciDeviceGuid;
- case NonDiscoverableDeviceTypeAmba:
- return &gEdkiiNonDiscoverableAmbaDeviceGuid;
+ case NonDiscoverableDeviceTypeAmba:
+ return &gEdkiiNonDiscoverableAmbaDeviceGuid;
- case NonDiscoverableDeviceTypeEhci:
- return &gEdkiiNonDiscoverableEhciDeviceGuid;
+ case NonDiscoverableDeviceTypeEhci:
+ return &gEdkiiNonDiscoverableEhciDeviceGuid;
- case NonDiscoverableDeviceTypeNvme:
- return &gEdkiiNonDiscoverableNvmeDeviceGuid;
+ case NonDiscoverableDeviceTypeNvme:
+ return &gEdkiiNonDiscoverableNvmeDeviceGuid;
- case NonDiscoverableDeviceTypeOhci:
- return &gEdkiiNonDiscoverableOhciDeviceGuid;
+ case NonDiscoverableDeviceTypeOhci:
+ return &gEdkiiNonDiscoverableOhciDeviceGuid;
- case NonDiscoverableDeviceTypeSdhci:
- return &gEdkiiNonDiscoverableSdhciDeviceGuid;
+ case NonDiscoverableDeviceTypeSdhci:
+ return &gEdkiiNonDiscoverableSdhciDeviceGuid;
- case NonDiscoverableDeviceTypeUfs:
- return &gEdkiiNonDiscoverableUfsDeviceGuid;
+ case NonDiscoverableDeviceTypeUfs:
+ return &gEdkiiNonDiscoverableUfsDeviceGuid;
- case NonDiscoverableDeviceTypeUhci:
- return &gEdkiiNonDiscoverableUhciDeviceGuid;
+ case NonDiscoverableDeviceTypeUhci:
+ return &gEdkiiNonDiscoverableUhciDeviceGuid;
- case NonDiscoverableDeviceTypeXhci:
- return &gEdkiiNonDiscoverableXhciDeviceGuid;
+ case NonDiscoverableDeviceTypeXhci:
+ return &gEdkiiNonDiscoverableXhciDeviceGuid;
- default:
- return NULL;
+ default:
+ return NULL;
}
}
#pragma pack (1)
typedef struct {
- VENDOR_DEVICE_PATH Vendor;
- UINT64 BaseAddress;
- UINT8 ResourceType;
- EFI_DEVICE_PATH_PROTOCOL End;
+ VENDOR_DEVICE_PATH Vendor;
+ UINT64 BaseAddress;
+ UINT8 ResourceType;
+ EFI_DEVICE_PATH_PROTOCOL End;
} NON_DISCOVERABLE_DEVICE_PATH;
#pragma pack ()
@@ -108,25 +108,26 @@ RegisterNonDiscoverableMmioDevice ( ...
)
{
- NON_DISCOVERABLE_DEVICE *Device;
- NON_DISCOVERABLE_DEVICE_PATH *DevicePath;
- EFI_HANDLE LocalHandle;
- EFI_STATUS Status;
- UINTN AllocSize;
- UINTN Index;
- VA_LIST Args;
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Desc;
- EFI_ACPI_END_TAG_DESCRIPTOR *End;
- UINTN Base, Size;
-
- if (Type >= NonDiscoverableDeviceTypeMax ||
- DmaType >= NonDiscoverableDeviceDmaTypeMax ||
- NumMmioResources == 0) {
+ NON_DISCOVERABLE_DEVICE *Device;
+ NON_DISCOVERABLE_DEVICE_PATH *DevicePath;
+ EFI_HANDLE LocalHandle;
+ EFI_STATUS Status;
+ UINTN AllocSize;
+ UINTN Index;
+ VA_LIST Args;
+ EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Desc;
+ EFI_ACPI_END_TAG_DESCRIPTOR *End;
+ UINTN Base, Size;
+
+ if ((Type >= NonDiscoverableDeviceTypeMax) ||
+ (DmaType >= NonDiscoverableDeviceDmaTypeMax) ||
+ (NumMmioResources == 0))
+ {
return EFI_INVALID_PARAMETER;
}
if (Handle == NULL) {
- Handle = &LocalHandle;
+ Handle = &LocalHandle;
LocalHandle = NULL;
}
@@ -141,13 +142,13 @@ RegisterNonDiscoverableMmioDevice ( Device->Type = GetGuidFromType (Type);
ASSERT (Device->Type != NULL);
- Device->DmaType = DmaType;
+ Device->DmaType = DmaType;
Device->Initialize = InitFunc;
- Device->Resources = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)(Device + 1);
+ Device->Resources = (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)(Device + 1);
VA_START (Args, NumMmioResources);
for (Index = 0; Index < NumMmioResources; Index++) {
- Desc = &Device->Resources [Index];
+ Desc = &Device->Resources[Index];
Base = VA_ARG (Args, UINTN);
Size = VA_ARG (Args, UINTN);
@@ -160,9 +161,10 @@ RegisterNonDiscoverableMmioDevice ( Desc->AddrSpaceGranularity = ((EFI_PHYSICAL_ADDRESS)Base + Size > SIZE_4GB) ? 64 : 32;
Desc->AddrTranslationOffset = 0;
}
+
VA_END (Args);
- End = (EFI_ACPI_END_TAG_DESCRIPTOR *)&Device->Resources [NumMmioResources];
+ End = (EFI_ACPI_END_TAG_DESCRIPTOR *)&Device->Resources[NumMmioResources];
End->Desc = ACPI_END_TAG_DESCRIPTOR;
End->Checksum = 0;
@@ -170,7 +172,8 @@ RegisterNonDiscoverableMmioDevice ( DevicePath = (NON_DISCOVERABLE_DEVICE_PATH *)CreateDeviceNode (
HARDWARE_DEVICE_PATH,
HW_VENDOR_DP,
- sizeof (*DevicePath));
+ sizeof (*DevicePath)
+ );
if (DevicePath == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto FreeDevice;
@@ -182,20 +185,27 @@ RegisterNonDiscoverableMmioDevice ( // Use the base address and type of the first region to
// make the device path unique
//
- DevicePath->BaseAddress = Device->Resources [0].AddrRangeMin;
- DevicePath->ResourceType = Device->Resources [0].ResType;
+ DevicePath->BaseAddress = Device->Resources[0].AddrRangeMin;
+ DevicePath->ResourceType = Device->Resources[0].ResType;
- SetDevicePathNodeLength (&DevicePath->Vendor,
- sizeof (*DevicePath) - sizeof (DevicePath->End));
+ SetDevicePathNodeLength (
+ &DevicePath->Vendor,
+ sizeof (*DevicePath) - sizeof (DevicePath->End)
+ );
SetDevicePathEndNode (&DevicePath->End);
- Status = gBS->InstallMultipleProtocolInterfaces (Handle,
- &gEdkiiNonDiscoverableDeviceProtocolGuid, Device,
- &gEfiDevicePathProtocolGuid, DevicePath,
- NULL);
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ Handle,
+ &gEdkiiNonDiscoverableDeviceProtocolGuid,
+ Device,
+ &gEfiDevicePathProtocolGuid,
+ DevicePath,
+ NULL
+ );
if (EFI_ERROR (Status)) {
goto FreeDevicePath;
}
+
return EFI_SUCCESS;
FreeDevicePath:
|