From a550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Sun, 5 Dec 2021 14:53:57 -0800 Subject: EmulatorPkg: Apply uncrustify changes REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the EmulatorPkg package Cc: Andrew Fish Cc: Leif Lindholm Cc: Michael D Kinney Signed-off-by: Michael Kubacki Reviewed-by: Ray Ni --- EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c | 196 +++++++++++++++------------------ 1 file changed, 88 insertions(+), 108 deletions(-) (limited to 'EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c') diff --git a/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c b/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c index 96424a82ae..4e8caf2514 100644 --- a/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c +++ b/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c @@ -7,7 +7,6 @@ bbe #include "EmuBlockIo.h" - /** Reset the block device hardware. @@ -28,9 +27,9 @@ EmuBlockIo2Reset ( IN BOOLEAN ExtendedVerification ) { - EFI_STATUS Status; - EMU_BLOCK_IO_PRIVATE *Private; - EFI_TPL OldTpl; + EFI_STATUS Status; + EMU_BLOCK_IO_PRIVATE *Private; + EFI_TPL OldTpl; Private = EMU_BLOCK_IO2_PRIVATE_DATA_FROM_THIS (This); @@ -78,17 +77,17 @@ EmuBlockIo2Reset ( EFI_STATUS EFIAPI EmuBlockIo2ReadBlocksEx ( - IN EFI_BLOCK_IO2_PROTOCOL *This, - IN UINT32 MediaId, - IN EFI_LBA LBA, - IN OUT EFI_BLOCK_IO2_TOKEN *Token, - IN UINTN BufferSize, - OUT VOID *Buffer + IN EFI_BLOCK_IO2_PROTOCOL *This, + IN UINT32 MediaId, + IN EFI_LBA LBA, + IN OUT EFI_BLOCK_IO2_TOKEN *Token, + IN UINTN BufferSize, + OUT VOID *Buffer ) { - EFI_STATUS Status; - EMU_BLOCK_IO_PRIVATE *Private; - EFI_TPL OldTpl; + EFI_STATUS Status; + EMU_BLOCK_IO_PRIVATE *Private; + EFI_TPL OldTpl; Private = EMU_BLOCK_IO2_PRIVATE_DATA_FROM_THIS (This); @@ -100,7 +99,6 @@ EmuBlockIo2ReadBlocksEx ( return Status; } - /** Write BufferSize bytes from Lba into Buffer. @@ -136,16 +134,16 @@ EFI_STATUS EFIAPI EmuBlockIo2WriteBlocksEx ( IN EFI_BLOCK_IO2_PROTOCOL *This, - IN UINT32 MediaId, - IN EFI_LBA LBA, - IN OUT EFI_BLOCK_IO2_TOKEN *Token, - IN UINTN BufferSize, - IN VOID *Buffer + IN UINT32 MediaId, + IN EFI_LBA LBA, + IN OUT EFI_BLOCK_IO2_TOKEN *Token, + IN UINTN BufferSize, + IN VOID *Buffer ) { - EFI_STATUS Status; - EMU_BLOCK_IO_PRIVATE *Private; - EFI_TPL OldTpl; + EFI_STATUS Status; + EMU_BLOCK_IO_PRIVATE *Private; + EFI_TPL OldTpl; Private = EMU_BLOCK_IO2_PRIVATE_DATA_FROM_THIS (This); @@ -157,8 +155,6 @@ EmuBlockIo2WriteBlocksEx ( return Status; } - - /** Flush the Block Device. @@ -184,13 +180,13 @@ EmuBlockIo2WriteBlocksEx ( EFI_STATUS EFIAPI EmuBlockIo2Flush ( - IN EFI_BLOCK_IO2_PROTOCOL *This, - IN OUT EFI_BLOCK_IO2_TOKEN *Token + IN EFI_BLOCK_IO2_PROTOCOL *This, + IN OUT EFI_BLOCK_IO2_TOKEN *Token ) { - EFI_STATUS Status; - EMU_BLOCK_IO_PRIVATE *Private; - EFI_TPL OldTpl; + EFI_STATUS Status; + EMU_BLOCK_IO_PRIVATE *Private; + EFI_TPL OldTpl; Private = EMU_BLOCK_IO2_PRIVATE_DATA_FROM_THIS (This); @@ -202,8 +198,6 @@ EmuBlockIo2Flush ( return Status; } - - /** Reset the Block Device. @@ -218,13 +212,13 @@ EmuBlockIo2Flush ( EFI_STATUS EFIAPI EmuBlockIoReset ( - IN EFI_BLOCK_IO_PROTOCOL *This, - IN BOOLEAN ExtendedVerification + IN EFI_BLOCK_IO_PROTOCOL *This, + IN BOOLEAN ExtendedVerification ) { - EFI_STATUS Status; - EMU_BLOCK_IO_PRIVATE *Private; - EFI_TPL OldTpl; + EFI_STATUS Status; + EMU_BLOCK_IO_PRIVATE *Private; + EFI_TPL OldTpl; Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This); @@ -236,7 +230,6 @@ EmuBlockIoReset ( return Status; } - /** Read BufferSize bytes from Lba into Buffer. @@ -259,30 +252,29 @@ EmuBlockIoReset ( EFI_STATUS EFIAPI EmuBlockIoReadBlocks ( - IN EFI_BLOCK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN EFI_LBA Lba, - IN UINTN BufferSize, - OUT VOID *Buffer + IN EFI_BLOCK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN EFI_LBA Lba, + IN UINTN BufferSize, + OUT VOID *Buffer ) { - EFI_STATUS Status; - EMU_BLOCK_IO_PRIVATE *Private; - EFI_TPL OldTpl; - EFI_BLOCK_IO2_TOKEN Token; + EFI_STATUS Status; + EMU_BLOCK_IO_PRIVATE *Private; + EFI_TPL OldTpl; + EFI_BLOCK_IO2_TOKEN Token; Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This); OldTpl = gBS->RaiseTPL (TPL_CALLBACK); Token.Event = NULL; - Status = Private->Io->ReadBlocks (Private->Io, MediaId, Lba, &Token, BufferSize, Buffer); + Status = Private->Io->ReadBlocks (Private->Io, MediaId, Lba, &Token, BufferSize, Buffer); gBS->RestoreTPL (OldTpl); return Status; } - /** Write BufferSize bytes from Lba into Buffer. @@ -306,24 +298,24 @@ EmuBlockIoReadBlocks ( EFI_STATUS EFIAPI EmuBlockIoWriteBlocks ( - IN EFI_BLOCK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN EFI_LBA Lba, - IN UINTN BufferSize, - IN VOID *Buffer + IN EFI_BLOCK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN EFI_LBA Lba, + IN UINTN BufferSize, + IN VOID *Buffer ) { - EFI_STATUS Status; - EMU_BLOCK_IO_PRIVATE *Private; - EFI_TPL OldTpl; - EFI_BLOCK_IO2_TOKEN Token; + EFI_STATUS Status; + EMU_BLOCK_IO_PRIVATE *Private; + EFI_TPL OldTpl; + EFI_BLOCK_IO2_TOKEN Token; Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This); OldTpl = gBS->RaiseTPL (TPL_CALLBACK); Token.Event = NULL; - Status = Private->Io->WriteBlocks (Private->Io, MediaId, Lba, &Token, BufferSize, Buffer); + Status = Private->Io->WriteBlocks (Private->Io, MediaId, Lba, &Token, BufferSize, Buffer); gBS->RestoreTPL (OldTpl); return Status; @@ -345,24 +337,22 @@ EmuBlockIoFlushBlocks ( IN EFI_BLOCK_IO_PROTOCOL *This ) { - EFI_STATUS Status; - EMU_BLOCK_IO_PRIVATE *Private; - EFI_TPL OldTpl; - EFI_BLOCK_IO2_TOKEN Token; + EFI_STATUS Status; + EMU_BLOCK_IO_PRIVATE *Private; + EFI_TPL OldTpl; + EFI_BLOCK_IO2_TOKEN Token; Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This); OldTpl = gBS->RaiseTPL (TPL_CALLBACK); Token.Event = NULL; - Status = Private->Io->FlushBlocks (Private->Io, &Token); + Status = Private->Io->FlushBlocks (Private->Io, &Token); gBS->RestoreTPL (OldTpl); 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. @@ -413,8 +403,8 @@ EmuBlockIoDriverBindingSupported ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ) { - EFI_STATUS Status; - EMU_IO_THUNK_PROTOCOL *EmuIoThunk; + EFI_STATUS Status; + EMU_IO_THUNK_PROTOCOL *EmuIoThunk; // // Open the IO Abstraction(s) needed to perform the supported test @@ -443,15 +433,14 @@ EmuBlockIoDriverBindingSupported ( // Close the I/O Abstraction(s) used to perform the supported test // gBS->CloseProtocol ( - Handle, - &gEmuIoThunkProtocolGuid, - This->DriverBindingHandle, - Handle - ); + Handle, + &gEmuIoThunkProtocolGuid, + This->DriverBindingHandle, + Handle + ); return Status; } - /** Starts a device controller or a bus controller. @@ -490,14 +479,14 @@ EmuBlockIoDriverBindingSupported ( EFI_STATUS EFIAPI EmuBlockIoDriverBindingStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Handle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE Handle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ) { - EFI_STATUS Status; - EMU_IO_THUNK_PROTOCOL *EmuIoThunk; - EMU_BLOCK_IO_PRIVATE *Private = NULL; + EFI_STATUS Status; + EMU_IO_THUNK_PROTOCOL *EmuIoThunk; + EMU_BLOCK_IO_PRIVATE *Private = NULL; // // Grab the protocols we need @@ -573,8 +562,10 @@ EmuBlockIoDriverBindingStart ( Status = gBS->InstallMultipleProtocolInterfaces ( &Handle, - &gEfiBlockIoProtocolGuid, &Private->BlockIo, - &gEfiBlockIo2ProtocolGuid, &Private->BlockIo2, + &gEfiBlockIoProtocolGuid, + &Private->BlockIo, + &gEfiBlockIo2ProtocolGuid, + &Private->BlockIo2, NULL ); @@ -586,21 +577,19 @@ Done: } gBS->FreePool (Private); - } gBS->CloseProtocol ( - Handle, - &gEmuIoThunkProtocolGuid, - This->DriverBindingHandle, - Handle - ); + Handle, + &gEmuIoThunkProtocolGuid, + This->DriverBindingHandle, + Handle + ); } return Status; } - /** Stops a device controller or a bus controller. @@ -636,9 +625,9 @@ EmuBlockIoDriverBindingStop ( IN EFI_HANDLE *ChildHandleBuffer ) { - EFI_BLOCK_IO_PROTOCOL *BlockIo; - EFI_STATUS Status; - EMU_BLOCK_IO_PRIVATE *Private; + EFI_BLOCK_IO_PROTOCOL *BlockIo; + EFI_STATUS Status; + EMU_BLOCK_IO_PRIVATE *Private; // // Get our context back @@ -659,8 +648,10 @@ EmuBlockIoDriverBindingStop ( Status = gBS->UninstallMultipleProtocolInterfaces ( Private->EfiHandle, - &gEfiBlockIoProtocolGuid, &Private->BlockIo, - &gEfiBlockIo2ProtocolGuid, &Private->BlockIo2, + &gEfiBlockIoProtocolGuid, + &Private->BlockIo, + &gEfiBlockIo2ProtocolGuid, + &Private->BlockIo2, NULL ); if (!EFI_ERROR (Status)) { @@ -686,11 +677,7 @@ EmuBlockIoDriverBindingStop ( return Status; } - - - - -EFI_DRIVER_BINDING_PROTOCOL gEmuBlockIoDriverBinding = { +EFI_DRIVER_BINDING_PROTOCOL gEmuBlockIoDriverBinding = { EmuBlockIoDriverBindingSupported, EmuBlockIoDriverBindingStart, EmuBlockIoDriverBindingStop, @@ -699,9 +686,6 @@ EFI_DRIVER_BINDING_PROTOCOL gEmuBlockIoDriverBinding = { NULL }; - - - /** The user Entry Point for module EmuBlockIo . The user code starts with this function. @@ -715,11 +699,11 @@ EFI_DRIVER_BINDING_PROTOCOL gEmuBlockIoDriverBinding = { EFI_STATUS EFIAPI InitializeEmuBlockIo ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) { - EFI_STATUS Status; + EFI_STATUS Status; Status = EfiLibInstallAllDriverProtocols2 ( ImageHandle, @@ -735,9 +719,5 @@ InitializeEmuBlockIo ( ); ASSERT_EFI_ERROR (Status); - return Status; } - - - -- cgit v1.2.3