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>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:09 -08:00
committed by mergify[bot]
parent d1050b9dff
commit ac0a286f4d
445 changed files with 30894 additions and 26369 deletions

View File

@@ -22,43 +22,62 @@
#pragma pack (1)
typedef struct {
VENDOR_DEVICE_PATH Vendor;
UINT64 PhysBase;
EFI_DEVICE_PATH_PROTOCOL End;
VENDOR_DEVICE_PATH Vendor;
UINT64 PhysBase;
EFI_DEVICE_PATH_PROTOCOL End;
} VIRTIO_TRANSPORT_DEVICE_PATH;
#pragma pack ()
EFI_STATUS
EFIAPI
InitializeVirtioFdtDxe (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status, FindNodeStatus;
FDT_CLIENT_PROTOCOL *FdtClient;
INT32 Node;
CONST UINT64 *Reg;
UINT32 RegSize;
VIRTIO_TRANSPORT_DEVICE_PATH *DevicePath;
EFI_HANDLE Handle;
UINT64 RegBase;
EFI_STATUS Status, FindNodeStatus;
FDT_CLIENT_PROTOCOL *FdtClient;
INT32 Node;
CONST UINT64 *Reg;
UINT32 RegSize;
VIRTIO_TRANSPORT_DEVICE_PATH *DevicePath;
EFI_HANDLE Handle;
UINT64 RegBase;
Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,
(VOID **)&FdtClient);
Status = gBS->LocateProtocol (
&gFdtClientProtocolGuid,
NULL,
(VOID **)&FdtClient
);
ASSERT_EFI_ERROR (Status);
for (FindNodeStatus = FdtClient->FindCompatibleNode (FdtClient,
"virtio,mmio", &Node);
for (FindNodeStatus = FdtClient->FindCompatibleNode (
FdtClient,
"virtio,mmio",
&Node
);
!EFI_ERROR (FindNodeStatus);
FindNodeStatus = FdtClient->FindNextCompatibleNode (FdtClient,
"virtio,mmio", Node, &Node)) {
Status = FdtClient->GetNodeProperty (FdtClient, Node, "reg",
(CONST VOID **)&Reg, &RegSize);
FindNodeStatus = FdtClient->FindNextCompatibleNode (
FdtClient,
"virtio,mmio",
Node,
&Node
))
{
Status = FdtClient->GetNodeProperty (
FdtClient,
Node,
"reg",
(CONST VOID **)&Reg,
&RegSize
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: GetNodeProperty () failed (Status == %r)\n",
__FUNCTION__, Status));
DEBUG ((
DEBUG_ERROR,
"%a: GetNodeProperty () failed (Status == %r)\n",
__FUNCTION__,
Status
));
continue;
}
@@ -67,11 +86,12 @@ InitializeVirtioFdtDxe (
//
// Create a unique device path for this transport on the fly
//
RegBase = SwapBytes64 (*Reg);
RegBase = SwapBytes64 (*Reg);
DevicePath = (VIRTIO_TRANSPORT_DEVICE_PATH *)CreateDeviceNode (
HARDWARE_DEVICE_PATH,
HW_VENDOR_DP,
sizeof (VIRTIO_TRANSPORT_DEVICE_PATH));
HARDWARE_DEVICE_PATH,
HW_VENDOR_DP,
sizeof (VIRTIO_TRANSPORT_DEVICE_PATH)
);
if (DevicePath == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Out of memory\n", __FUNCTION__));
continue;
@@ -79,39 +99,62 @@ InitializeVirtioFdtDxe (
CopyGuid (&DevicePath->Vendor.Guid, &gVirtioMmioTransportGuid);
DevicePath->PhysBase = RegBase;
SetDevicePathNodeLength (&DevicePath->Vendor,
sizeof (*DevicePath) - sizeof (DevicePath->End));
SetDevicePathNodeLength (
&DevicePath->Vendor,
sizeof (*DevicePath) - sizeof (DevicePath->End)
);
SetDevicePathEndNode (&DevicePath->End);
Handle = NULL;
Status = gBS->InstallProtocolInterface (&Handle,
&gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,
DevicePath);
Status = gBS->InstallProtocolInterface (
&Handle,
&gEfiDevicePathProtocolGuid,
EFI_NATIVE_INTERFACE,
DevicePath
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Failed to install the EFI_DEVICE_PATH "
DEBUG ((
DEBUG_ERROR,
"%a: Failed to install the EFI_DEVICE_PATH "
"protocol on a new handle (Status == %r)\n",
__FUNCTION__, Status));
__FUNCTION__,
Status
));
FreePool (DevicePath);
continue;
}
Status = VirtioMmioInstallDevice (RegBase, Handle);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Failed to install VirtIO transport @ 0x%Lx "
"on handle %p (Status == %r)\n", __FUNCTION__, RegBase,
Handle, Status));
DEBUG ((
DEBUG_ERROR,
"%a: Failed to install VirtIO transport @ 0x%Lx "
"on handle %p (Status == %r)\n",
__FUNCTION__,
RegBase,
Handle,
Status
));
Status = gBS->UninstallProtocolInterface (Handle,
&gEfiDevicePathProtocolGuid, DevicePath);
Status = gBS->UninstallProtocolInterface (
Handle,
&gEfiDevicePathProtocolGuid,
DevicePath
);
ASSERT_EFI_ERROR (Status);
FreePool (DevicePath);
continue;
}
}
if (EFI_ERROR (FindNodeStatus) && FindNodeStatus != EFI_NOT_FOUND) {
DEBUG ((DEBUG_ERROR, "%a: Error occurred while iterating DT nodes "
"(FindNodeStatus == %r)\n", __FUNCTION__, FindNodeStatus));
if (EFI_ERROR (FindNodeStatus) && (FindNodeStatus != EFI_NOT_FOUND)) {
DEBUG ((
DEBUG_ERROR,
"%a: Error occurred while iterating DT nodes "
"(FindNodeStatus == %r)\n",
__FUNCTION__,
FindNodeStatus
));
}
return EFI_SUCCESS;