]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: AcpiTableDxe: fix VS2008 build by merging adjacent if blocks
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 25 Feb 2016 16:20:21 +0000 (17:20 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 26 Feb 2016 13:02:36 +0000 (14:02 +0100)
The assignment of CurrentRsdtEntry and its subsequent dereference are
subject to the same condition, but for some reason, VS2008 does not see
that and warns about the dereference possibly involving an uninitialized
pointer. Since the single statememt between the blocks is unrelated, we
can just move it and merge the two conditional blocks together.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c

index f069458b1cbaeb84f5c5e05c4db886072cc3052f..f6229ca05c101ab2bf1ea4f8f7be03c1ab88d1ea 100644 (file)
@@ -963,6 +963,16 @@ AddTableToList (
            AcpiTableInstance->NumberOfTableEntries3 *\r
            sizeof (UINT32)\r
          );\r
+\r
+        //\r
+        // Add entry to the RSDT\r
+        //\r
+        *CurrentRsdtEntry = (UINT32) (UINTN) CurrentTableList->Table;\r
+\r
+        //\r
+        // Update RSDT length\r
+        //\r
+        AcpiTableInstance->Rsdt3->Length = AcpiTableInstance->Rsdt3->Length + sizeof (UINT32);\r
       }\r
 \r
       //\r
@@ -977,18 +987,6 @@ AddTableToList (
           sizeof (UINT64)\r
         );\r
 \r
-      if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {\r
-        //\r
-        // Add entry to the RSDT\r
-        //\r
-        *CurrentRsdtEntry = (UINT32) (UINTN) CurrentTableList->Table;\r
-\r
-        //\r
-        // Update RSDT length\r
-        //\r
-        AcpiTableInstance->Rsdt3->Length = AcpiTableInstance->Rsdt3->Length + sizeof (UINT32);\r
-      }\r
-\r
       //\r
       // Add entry to XSDT, XSDT expects 64 bit pointers, but\r
       // the table pointers in XSDT are not aligned on 8 byte boundary.\r