mirror of https://github.com/acidanthera/audk.git
OvmfPkg/QemuFlashFvbServicesRuntimeDxe: eliminate unchecked PcdSetXX() calls
These are deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Introduce a variable called PcdStatus, and use it to assert the success of these operations (there is no reason for them to fail here). Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
32e083c71d
commit
65157adef2
|
@ -965,6 +965,7 @@ FvbInitialize (
|
||||||
EFI_PHYSICAL_ADDRESS BaseAddress;
|
EFI_PHYSICAL_ADDRESS BaseAddress;
|
||||||
UINTN Length;
|
UINTN Length;
|
||||||
UINTN NumOfBlocks;
|
UINTN NumOfBlocks;
|
||||||
|
RETURN_STATUS PcdStatus;
|
||||||
|
|
||||||
if (EFI_ERROR (QemuFlashInitialize ())) {
|
if (EFI_ERROR (QemuFlashInitialize ())) {
|
||||||
//
|
//
|
||||||
|
@ -1095,18 +1096,21 @@ FvbInitialize (
|
||||||
//
|
//
|
||||||
// Set several PCD values to point to flash
|
// Set several PCD values to point to flash
|
||||||
//
|
//
|
||||||
PcdSet64 (
|
PcdStatus = PcdSet64S (
|
||||||
PcdFlashNvStorageVariableBase64,
|
PcdFlashNvStorageVariableBase64,
|
||||||
(UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase)
|
(UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase)
|
||||||
);
|
);
|
||||||
PcdSet32 (
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
PcdStatus = PcdSet32S (
|
||||||
PcdFlashNvStorageFtwWorkingBase,
|
PcdFlashNvStorageFtwWorkingBase,
|
||||||
PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase)
|
PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase)
|
||||||
);
|
);
|
||||||
PcdSet32 (
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
PcdStatus = PcdSet32S (
|
||||||
PcdFlashNvStorageFtwSpareBase,
|
PcdFlashNvStorageFtwSpareBase,
|
||||||
PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase)
|
PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase)
|
||||||
);
|
);
|
||||||
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
|
||||||
FwhInstance = (EFI_FW_VOL_INSTANCE *)
|
FwhInstance = (EFI_FW_VOL_INSTANCE *)
|
||||||
(
|
(
|
||||||
|
@ -1119,6 +1123,7 @@ FvbInitialize (
|
||||||
//
|
//
|
||||||
InstallVirtualAddressChangeHandler ();
|
InstallVirtualAddressChangeHandler ();
|
||||||
|
|
||||||
PcdSetBool (PcdOvmfFlashVariablesEnable, TRUE);
|
PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE);
|
||||||
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue