]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/PlatformDxe: 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:20 +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>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # RVCT
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/PlatformDxe/Platform.c

index 4ec327e763f65ec18346f9dace2e9745c9f01155..126d8e73823b408e1980581b3ce5f3b9f4ad6c08 100644 (file)
@@ -663,6 +663,7 @@ ExecutePlatformConfig (
   EFI_STATUS      Status;\r
   PLATFORM_CONFIG PlatformConfig;\r
   UINT64          OptionalElements;\r
+  RETURN_STATUS   PcdStatus;\r
 \r
   Status = PlatformConfigLoad (&PlatformConfig, &OptionalElements);\r
   if (EFI_ERROR (Status)) {\r
@@ -675,10 +676,13 @@ ExecutePlatformConfig (
     //\r
     // Pass the preferred resolution to GraphicsConsoleDxe via dynamic PCDs.\r
     //\r
-    PcdSet32 (PcdVideoHorizontalResolution,\r
+    PcdStatus = PcdSet32S (PcdVideoHorizontalResolution,\r
       PlatformConfig.HorizontalResolution);\r
-    PcdSet32 (PcdVideoVerticalResolution,\r
+    ASSERT_RETURN_ERROR (PcdStatus);\r
+\r
+    PcdStatus = PcdSet32S (PcdVideoVerticalResolution,\r
       PlatformConfig.VerticalResolution);\r
+    ASSERT_RETURN_ERROR (PcdStatus);\r
   }\r
 \r
   return EFI_SUCCESS;\r