OvmfPkg/PlatformPei: 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: Anthony PERARD <anthony.perard@citrix.com> Cc: Gary Lin <glin@suse.com> 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: Gary Lin <glin@suse.com> Tested-by: Gary Lin <glin@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
@@ -107,6 +107,7 @@ GetFirstNonAddress (
|
||||
FIRMWARE_CONFIG_ITEM FwCfgItem;
|
||||
UINTN FwCfgSize;
|
||||
UINT64 HotPlugMemoryEnd;
|
||||
RETURN_STATUS PcdStatus;
|
||||
|
||||
FirstNonAddress = BASE_4GB + GetSystemMemorySizeAbove4gb ();
|
||||
|
||||
@@ -154,7 +155,8 @@ GetFirstNonAddress (
|
||||
if (mBootMode != BOOT_ON_S3_RESUME) {
|
||||
DEBUG ((EFI_D_INFO, "%a: disabling 64-bit PCI host aperture\n",
|
||||
__FUNCTION__));
|
||||
PcdSet64 (PcdPciMmio64Size, 0);
|
||||
PcdStatus = PcdSet64S (PcdPciMmio64Size, 0);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -202,8 +204,11 @@ GetFirstNonAddress (
|
||||
// the GCD memory space map through our PciHostBridgeLib instance; here we
|
||||
// only need to set the PCDs.
|
||||
//
|
||||
PcdSet64 (PcdPciMmio64Base, Pci64Base);
|
||||
PcdSet64 (PcdPciMmio64Size, Pci64Size);
|
||||
PcdStatus = PcdSet64S (PcdPciMmio64Base, Pci64Base);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
PcdStatus = PcdSet64S (PcdPciMmio64Size, Pci64Size);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
|
||||
DEBUG ((EFI_D_INFO, "%a: Pci64Base=0x%Lx Pci64Size=0x%Lx\n",
|
||||
__FUNCTION__, Pci64Base, Pci64Size));
|
||||
}
|
||||
|
Reference in New Issue
Block a user