summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-02-25 17:20:21 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-02-26 14:02:36 +0100
commit3a61de23b3b3390235bf8f95cde117a8f7dd5f62 (patch)
treece5efb75345adbb38fd5ccfeb551612d9824a374 /MdeModulePkg/Universal
parent6474f1f156eefa6886e594039f4d562e374ba344 (diff)
downloadedk2-3a61de23b3b3390235bf8f95cde117a8f7dd5f62.tar.gz
edk2-3a61de23b3b3390235bf8f95cde117a8f7dd5f62.tar.bz2
edk2-3a61de23b3b3390235bf8f95cde117a8f7dd5f62.zip
MdeModulePkg: AcpiTableDxe: fix VS2008 build by merging adjacent if blocks
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>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
index f069458b1c..f6229ca05c 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
@@ -963,6 +963,16 @@ AddTableToList (
AcpiTableInstance->NumberOfTableEntries3 *
sizeof (UINT32)
);
+
+ //
+ // Add entry to the RSDT
+ //
+ *CurrentRsdtEntry = (UINT32) (UINTN) CurrentTableList->Table;
+
+ //
+ // Update RSDT length
+ //
+ AcpiTableInstance->Rsdt3->Length = AcpiTableInstance->Rsdt3->Length + sizeof (UINT32);
}
//
@@ -977,18 +987,6 @@ AddTableToList (
sizeof (UINT64)
);
- if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
- //
- // Add entry to the RSDT
- //
- *CurrentRsdtEntry = (UINT32) (UINTN) CurrentTableList->Table;
-
- //
- // Update RSDT length
- //
- AcpiTableInstance->Rsdt3->Length = AcpiTableInstance->Rsdt3->Length + sizeof (UINT32);
- }
-
//
// Add entry to XSDT, XSDT expects 64 bit pointers, but
// the table pointers in XSDT are not aligned on 8 byte boundary.