]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/QemuFlashFvbServicesRuntimeDxe: eliminate unchecked PcdSetXX() calls
authorLaszlo Ersek <lersek@redhat.com>
Fri, 21 Oct 2016 09:59:36 +0000 (11:59 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 25 Oct 2016 08:46:24 +0000 (10:46 +0200)
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>
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c

index c37aed1c9e7b6c31c9bcb0e28593ddf800045c50..ff27c1100c01bcce9c17493d2788e1b9cf866f9d 100644 (file)
@@ -965,6 +965,7 @@ FvbInitialize (
   EFI_PHYSICAL_ADDRESS                BaseAddress;\r
   UINTN                               Length;\r
   UINTN                               NumOfBlocks;\r
+  RETURN_STATUS                       PcdStatus;\r
 \r
   if (EFI_ERROR (QemuFlashInitialize ())) {\r
     //\r
@@ -1095,18 +1096,21 @@ FvbInitialize (
   //\r
   // Set several PCD values to point to flash\r
   //\r
-  PcdSet64 (\r
+  PcdStatus = PcdSet64S (\r
     PcdFlashNvStorageVariableBase64,\r
     (UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase)\r
     );\r
-  PcdSet32 (\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
+  PcdStatus = PcdSet32S (\r
     PcdFlashNvStorageFtwWorkingBase,\r
     PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase)\r
     );\r
-  PcdSet32 (\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
+  PcdStatus = PcdSet32S (\r
     PcdFlashNvStorageFtwSpareBase,\r
     PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase)\r
     );\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
 \r
   FwhInstance = (EFI_FW_VOL_INSTANCE *)\r
     (\r
@@ -1119,6 +1123,7 @@ FvbInitialize (
   //\r
   InstallVirtualAddressChangeHandler ();\r
 \r
-  PcdSetBool (PcdOvmfFlashVariablesEnable, TRUE);\r
+  PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE);\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
   return EFI_SUCCESS;\r
 }\r