summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformDxe
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-10-21 11:59:36 +0200
committerLaszlo Ersek <lersek@redhat.com>2016-10-25 10:46:20 +0200
commit4d1362e1f982669ce630901126b97ff36b7806de (patch)
treed3ef6abed71ae6c9326deedda5758a782ca657b7 /OvmfPkg/PlatformDxe
parentae23afb4e7481c9f079ebabb2a0341fdf9c4964b (diff)
downloadedk2-4d1362e1f982669ce630901126b97ff36b7806de.tar.gz
edk2-4d1362e1f982669ce630901126b97ff36b7806de.tar.bz2
edk2-4d1362e1f982669ce630901126b97ff36b7806de.zip
OvmfPkg/PlatformDxe: 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> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # RVCT Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'OvmfPkg/PlatformDxe')
-rw-r--r--OvmfPkg/PlatformDxe/Platform.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platform.c
index 4ec327e763..126d8e7382 100644
--- a/OvmfPkg/PlatformDxe/Platform.c
+++ b/OvmfPkg/PlatformDxe/Platform.c
@@ -663,6 +663,7 @@ ExecutePlatformConfig (
EFI_STATUS Status;
PLATFORM_CONFIG PlatformConfig;
UINT64 OptionalElements;
+ RETURN_STATUS PcdStatus;
Status = PlatformConfigLoad (&PlatformConfig, &OptionalElements);
if (EFI_ERROR (Status)) {
@@ -675,10 +676,13 @@ ExecutePlatformConfig (
//
// Pass the preferred resolution to GraphicsConsoleDxe via dynamic PCDs.
//
- PcdSet32 (PcdVideoHorizontalResolution,
+ PcdStatus = PcdSet32S (PcdVideoHorizontalResolution,
PlatformConfig.HorizontalResolution);
- PcdSet32 (PcdVideoVerticalResolution,
+ ASSERT_RETURN_ERROR (PcdStatus);
+
+ PcdStatus = PcdSet32S (PcdVideoVerticalResolution,
PlatformConfig.VerticalResolution);
+ ASSERT_RETURN_ERROR (PcdStatus);
}
return EFI_SUCCESS;