]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CorebootPayloadPkg PlatformHookLib: Fix GCC build failure
authorStar Zeng <star.zeng@intel.com>
Mon, 30 Nov 2015 21:11:29 +0000 (21:11 +0000)
committerlersek <lersek@Edk2>
Mon, 30 Nov 2015 21:11:29 +0000 (21:11 +0000)
Add return status check to fix GCC build failure below.

error: right-hand operand of comma expression has no effect
[-Werror=unused-value]
((_gPcd_BinaryPatch_PcdSerialUseMmio = (Value)), RETURN_SUCCESS)

error: right-hand operand of comma expression has no effect
[-Werror=unused-value]
((_gPcd_BinaryPatch_PcdSerialRegisterBase = (Value)), RETURN_SUCCESS)

http://article.gmane.org/gmane.comp.bios.edk2.devel/4949

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Suggested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19069 6f19259b-4bc3-4df7-8a09-765794883524

CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c

index 10fd332fe546de652e83ef99555d198bf69a4483..84499970503eaf0d164865e07677bf308c9c43ce 100644 (file)
@@ -45,11 +45,17 @@ PlatformHookSerialPortInitialize (
   }\r
 \r
   if (SerialRegAccessType == 2) { //MMIO\r
-    PcdSetBoolS (PcdSerialUseMmio, TRUE);\r
+    Status = PcdSetBoolS (PcdSerialUseMmio, TRUE);\r
   } else { //IO\r
-    PcdSetBoolS (PcdSerialUseMmio, FALSE);\r
+    Status = PcdSetBoolS (PcdSerialUseMmio, FALSE);\r
+  }\r
+  if (RETURN_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+  Status = PcdSet64S (PcdSerialRegisterBase, (UINT64) SerialRegBase);\r
+  if (RETURN_ERROR (Status)) {\r
+    return Status;\r
   }\r
-  PcdSet64S (PcdSerialRegisterBase, (UINT64) SerialRegBase);\r
 \r
   return RETURN_SUCCESS;\r
 }\r