diff options
Diffstat (limited to 'MdeModulePkg/Core/Dxe/FwVol/Ffs.c')
-rw-r--r-- | MdeModulePkg/Core/Dxe/FwVol/Ffs.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/MdeModulePkg/Core/Dxe/FwVol/Ffs.c b/MdeModulePkg/Core/Dxe/FwVol/Ffs.c index 7673352bba..00d07567f7 100644 --- a/MdeModulePkg/Core/Dxe/FwVol/Ffs.c +++ b/MdeModulePkg/Core/Dxe/FwVol/Ffs.c @@ -15,8 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <DxeMain.h>
-#define PHYSICAL_ADDRESS_TO_POINTER(Address) ((VOID *)((UINTN)(Address)))
-
/**
Get the FFS file state by checking the highest bit set in the header's state field.
@@ -47,7 +45,7 @@ GetFileState ( HighestBit >>= 1;
}
- return (EFI_FFS_FILE_STATE)HighestBit;
+ return (EFI_FFS_FILE_STATE) HighestBit;
}
@@ -183,24 +181,23 @@ IsValidFfsHeader ( *FileState = GetFileState (ErasePolarity, FfsHeader);
switch (*FileState) {
- case EFI_FILE_HEADER_VALID:
- case EFI_FILE_DATA_VALID:
- case EFI_FILE_MARKED_FOR_UPDATE:
- case EFI_FILE_DELETED:
- //
- // Here we need to verify header checksum
- //
- return VerifyHeaderChecksum (FfsHeader);
-
- case EFI_FILE_HEADER_CONSTRUCTION:
- case EFI_FILE_HEADER_INVALID:
- default:
- return FALSE;
+ case EFI_FILE_HEADER_VALID:
+ case EFI_FILE_DATA_VALID:
+ case EFI_FILE_MARKED_FOR_UPDATE:
+ case EFI_FILE_DELETED:
+ //
+ // Here we need to verify header checksum
+ //
+ return VerifyHeaderChecksum (FfsHeader);
+
+ case EFI_FILE_HEADER_CONSTRUCTION:
+ case EFI_FILE_HEADER_INVALID:
+ default:
+ return FALSE;
}
}
-
/**
Check if it's a valid FFS file.
Here we are sure that it has a valid FFS file header since we must call IsValidFfsHeader() first.
@@ -223,17 +220,17 @@ IsValidFfsFile ( FileState = GetFileState (ErasePolarity, FfsHeader);
switch (FileState) {
- case EFI_FILE_DELETED:
- case EFI_FILE_DATA_VALID:
- case EFI_FILE_MARKED_FOR_UPDATE:
- //
- // Some other vliadation like file content checksum might be done here.
- // For performance issue, Tiano only do FileState check.
- //
- return TRUE;
+ case EFI_FILE_DELETED:
+ case EFI_FILE_DATA_VALID:
+ case EFI_FILE_MARKED_FOR_UPDATE:
+ //
+ // Some other vliadation like file content checksum might be done here.
+ // For performance issue, Tiano only do FileState check.
+ //
+ return TRUE;
- default:
- return FALSE;
+ default:
+ return FALSE;
}
}
|