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>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:02 -08:00
committed by mergify[bot]
parent 7c7184e201
commit 1436aea4d5
994 changed files with 107608 additions and 101311 deletions

View File

@ -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;
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) {
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: