summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c')
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c55
1 files changed, 26 insertions, 29 deletions
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c
index de38ea028a..965dd3968e 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c
@@ -47,8 +47,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/UefiBootServicesTableLib.h>
#include "FaultTolerantWrite.h"
-VOID *mFvbRegistration = NULL;
-
+VOID *mFvbRegistration = NULL;
/**
Retrieve the FVB protocol interface by HANDLE.
@@ -74,7 +73,7 @@ FtwGetFvbByHandle (
return gBS->HandleProtocol (
FvBlockHandle,
&gEfiFirmwareVolumeBlockProtocolGuid,
- (VOID **) FvBlock
+ (VOID **)FvBlock
);
}
@@ -90,10 +89,10 @@ FtwGetFvbByHandle (
**/
EFI_STATUS
FtwGetSarProtocol (
- OUT VOID **SarProtocol
+ OUT VOID **SarProtocol
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
//
// Locate Swap Address Range protocol
@@ -123,11 +122,11 @@ FtwGetSarProtocol (
**/
EFI_STATUS
GetFvbCountAndBuffer (
- OUT UINTN *NumberHandles,
- OUT EFI_HANDLE **Buffer
+ OUT UINTN *NumberHandles,
+ OUT EFI_HANDLE **Buffer
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
//
// Locate all handles of Fvb protocol
@@ -142,7 +141,6 @@ GetFvbCountAndBuffer (
return Status;
}
-
/**
Firmware Volume Block Protocol notification event handler.
@@ -153,13 +151,13 @@ GetFvbCountAndBuffer (
VOID
EFIAPI
FvbNotificationEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
- EFI_STATUS Status;
- EFI_FAULT_TOLERANT_WRITE_PROTOCOL *FtwProtocol;
- EFI_FTW_DEVICE *FtwDevice;
+ EFI_STATUS Status;
+ EFI_FAULT_TOLERANT_WRITE_PROTOCOL *FtwProtocol;
+ EFI_FTW_DEVICE *FtwDevice;
//
// Just return to avoid installing FaultTolerantWriteProtocol again
@@ -168,19 +166,19 @@ FvbNotificationEvent (
Status = gBS->LocateProtocol (
&gEfiFaultTolerantWriteProtocolGuid,
NULL,
- (VOID **) &FtwProtocol
+ (VOID **)&FtwProtocol
);
if (!EFI_ERROR (Status)) {
- return ;
+ return;
}
//
// Found proper FVB protocol and initialize FtwDevice for protocol installation
//
FtwDevice = (EFI_FTW_DEVICE *)Context;
- Status = InitFtwProtocol (FtwDevice);
- if (EFI_ERROR(Status)) {
- return ;
+ Status = InitFtwProtocol (FtwDevice);
+ if (EFI_ERROR (Status)) {
+ return;
}
//
@@ -200,7 +198,6 @@ FvbNotificationEvent (
return;
}
-
/**
This function is the entry point of the Fault Tolerant Write driver.
@@ -215,12 +212,12 @@ FvbNotificationEvent (
EFI_STATUS
EFIAPI
FaultTolerantWriteInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- EFI_FTW_DEVICE *FtwDevice;
+ EFI_STATUS Status;
+ EFI_FTW_DEVICE *FtwDevice;
FtwDevice = NULL;
@@ -228,7 +225,7 @@ FaultTolerantWriteInitialize (
// Allocate private data structure for FTW protocol and do some initialization
//
Status = InitFtwDevice (&FtwDevice);
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR (Status)) {
return Status;
}
@@ -263,12 +260,12 @@ FaultTolerantWriteInitialize (
**/
UINT32
FtwCalculateCrc32 (
- IN VOID *Buffer,
- IN UINTN Length
+ IN VOID *Buffer,
+ IN UINTN Length
)
{
- EFI_STATUS Status;
- UINT32 ReturnValue;
+ EFI_STATUS Status;
+ UINT32 ReturnValue;
Status = gBS->CalculateCrc32 (Buffer, Length, &ReturnValue);
ASSERT_EFI_ERROR (Status);