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

@@ -16,11 +16,10 @@
#include "BlockFront.h"
///
/// Driver Binding Protocol instance
///
EFI_DRIVER_BINDING_PROTOCOL gXenPvBlkDxeDriverBinding = {
EFI_DRIVER_BINDING_PROTOCOL gXenPvBlkDxeDriverBinding = {
XenPvBlkDxeDriverBindingSupported,
XenPvBlkDxeDriverBindingStart,
XenPvBlkDxeDriverBindingStop,
@@ -29,7 +28,6 @@ EFI_DRIVER_BINDING_PROTOCOL gXenPvBlkDxeDriverBinding = {
NULL
};
/**
Unloads an image.
@@ -51,7 +49,6 @@ XenPvBlkDxeUnload (
UINTN HandleCount;
UINTN Index;
//
// Retrieve array of all handles in the handle database
//
@@ -78,15 +75,17 @@ XenPvBlkDxeUnload (
//
FreePool (HandleBuffer);
//
// Uninstall protocols installed in the driver entry point
//
Status = gBS->UninstallMultipleProtocolInterfaces (
ImageHandle,
&gEfiDriverBindingProtocolGuid, &gXenPvBlkDxeDriverBinding,
&gEfiComponentNameProtocolGuid, &gXenPvBlkDxeComponentName,
&gEfiComponentName2ProtocolGuid, &gXenPvBlkDxeComponentName2,
&gEfiDriverBindingProtocolGuid,
&gXenPvBlkDxeDriverBinding,
&gEfiComponentNameProtocolGuid,
&gXenPvBlkDxeComponentName,
&gEfiComponentName2ProtocolGuid,
&gXenPvBlkDxeComponentName2,
NULL
);
if (EFI_ERROR (Status)) {
@@ -132,7 +131,6 @@ XenPvBlkDxeDriverEntryPoint (
return Status;
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
@@ -183,28 +181,33 @@ XenPvBlkDxeDriverBindingSupported (
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
{
EFI_STATUS Status;
XENBUS_PROTOCOL *XenBusIo;
EFI_STATUS Status;
XENBUS_PROTOCOL *XenBusIo;
Status = gBS->OpenProtocol (
ControllerHandle,
&gXenBusProtocolGuid,
(VOID **)&XenBusIo,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
ControllerHandle,
&gXenBusProtocolGuid,
(VOID **)&XenBusIo,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
return Status;
}
if (AsciiStrCmp (XenBusIo->Type, "vbd") == 0) {
Status = EFI_SUCCESS;
} else {
Status = EFI_UNSUPPORTED;
}
gBS->CloseProtocol (ControllerHandle, &gXenBusProtocolGuid,
This->DriverBindingHandle, ControllerHandle);
gBS->CloseProtocol (
ControllerHandle,
&gXenBusProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
return Status;
}
@@ -252,19 +255,19 @@ XenPvBlkDxeDriverBindingStart (
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
{
EFI_STATUS Status;
XENBUS_PROTOCOL *XenBusIo;
XEN_BLOCK_FRONT_DEVICE *Dev;
EFI_BLOCK_IO_MEDIA *Media;
EFI_STATUS Status;
XENBUS_PROTOCOL *XenBusIo;
XEN_BLOCK_FRONT_DEVICE *Dev;
EFI_BLOCK_IO_MEDIA *Media;
Status = gBS->OpenProtocol (
ControllerHandle,
&gXenBusProtocolGuid,
(VOID **)&XenBusIo,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
ControllerHandle,
&gXenBusProtocolGuid,
(VOID **)&XenBusIo,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -275,13 +278,16 @@ XenPvBlkDxeDriverBindingStart (
}
CopyMem (&Dev->BlockIo, &gXenPvBlkDxeBlockIo, sizeof (EFI_BLOCK_IO_PROTOCOL));
Media = AllocateCopyPool (sizeof (EFI_BLOCK_IO_MEDIA),
&gXenPvBlkDxeBlockIoMedia);
Media = AllocateCopyPool (
sizeof (EFI_BLOCK_IO_MEDIA),
&gXenPvBlkDxeBlockIoMedia
);
if (Dev->MediaInfo.VDiskInfo & VDISK_REMOVABLE) {
Media->RemovableMedia = TRUE;
}
Media->MediaPresent = TRUE;
Media->ReadOnly = !Dev->MediaInfo.ReadWrite;
Media->ReadOnly = !Dev->MediaInfo.ReadWrite;
if (Dev->MediaInfo.CdRom) {
//
// If it's a cdrom, the blocksize value need to be 2048 for OVMF to
@@ -289,20 +295,24 @@ XenPvBlkDxeDriverBindingStart (
// MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c
//
Media->BlockSize = 2048;
Media->LastBlock = DivU64x32 (Dev->MediaInfo.Sectors,
Media->BlockSize / Dev->MediaInfo.SectorSize) - 1;
Media->LastBlock = DivU64x32 (
Dev->MediaInfo.Sectors,
Media->BlockSize / Dev->MediaInfo.SectorSize
) - 1;
} else {
Media->BlockSize = Dev->MediaInfo.SectorSize;
Media->LastBlock = Dev->MediaInfo.Sectors - 1;
}
ASSERT (Media->BlockSize % 512 == 0);
Dev->BlockIo.Media = Media;
Status = gBS->InstallMultipleProtocolInterfaces (
&ControllerHandle,
&gEfiBlockIoProtocolGuid, &Dev->BlockIo,
NULL
);
&ControllerHandle,
&gEfiBlockIoProtocolGuid,
&Dev->BlockIo,
NULL
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "XenPvBlk: install protocol fail: %r\n", Status));
goto UninitBlockFront;
@@ -314,8 +324,12 @@ UninitBlockFront:
FreePool (Media);
XenPvBlockFrontShutdown (Dev);
CloseProtocol:
gBS->CloseProtocol (ControllerHandle, &gXenBusProtocolGuid,
This->DriverBindingHandle, ControllerHandle);
gBS->CloseProtocol (
ControllerHandle,
&gXenBusProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
return Status;
}
@@ -354,35 +368,44 @@ XenPvBlkDxeDriverBindingStop (
IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
)
{
EFI_BLOCK_IO_PROTOCOL *BlockIo;
XEN_BLOCK_FRONT_DEVICE *Dev;
EFI_BLOCK_IO_MEDIA *Media;
EFI_STATUS Status;
EFI_BLOCK_IO_PROTOCOL *BlockIo;
XEN_BLOCK_FRONT_DEVICE *Dev;
EFI_BLOCK_IO_MEDIA *Media;
EFI_STATUS Status;
Status = gBS->OpenProtocol (
ControllerHandle, &gEfiBlockIoProtocolGuid,
ControllerHandle,
&gEfiBlockIoProtocolGuid,
(VOID **)&BlockIo,
This->DriverBindingHandle, ControllerHandle,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (EFI_ERROR (Status)) {
return Status;
}
Status = gBS->UninstallProtocolInterface (ControllerHandle,
&gEfiBlockIoProtocolGuid, BlockIo);
Status = gBS->UninstallProtocolInterface (
ControllerHandle,
&gEfiBlockIoProtocolGuid,
BlockIo
);
if (EFI_ERROR (Status)) {
return Status;
}
Media = BlockIo->Media;
Dev = XEN_BLOCK_FRONT_FROM_BLOCK_IO (BlockIo);
Dev = XEN_BLOCK_FRONT_FROM_BLOCK_IO (BlockIo);
XenPvBlockFrontShutdown (Dev);
FreePool (Media);
gBS->CloseProtocol (ControllerHandle, &gXenBusProtocolGuid,
This->DriverBindingHandle, ControllerHandle);
gBS->CloseProtocol (
ControllerHandle,
&gXenBusProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
return EFI_SUCCESS;
}