From patchwork Thu Feb 25 16:25:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 62897 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp250834lbc; Thu, 25 Feb 2016 08:25:34 -0800 (PST) X-Received: by 10.66.132.73 with SMTP id os9mr63651967pab.27.1456417534721; Thu, 25 Feb 2016 08:25:34 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id x13si13401690pfi.97.2016.02.25.08.25.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Feb 2016 08:25:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9C9D31A1DF3; Thu, 25 Feb 2016 08:25:38 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 610DB1A1DEF for ; Thu, 25 Feb 2016 08:25:37 -0800 (PST) Received: by mail-wm0-x229.google.com with SMTP id g62so38977576wme.0 for ; Thu, 25 Feb 2016 08:25:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=gseNzKS3WN6WTibDd3enDyU19sBafsflMQSmiPuuGBw=; b=Ta8CLPpxvT1AQmJ+wUkIxuixytggBZZc2wi3/JpBDCSUS5vMig8i6sNUVsVCJ33bHY YzwLdRAU07fkGaAvRtkz6ygANRB/9rwxrRM/eQbTDzPGNH2xqB4abeinE+WGWRFOTSU3 lobmiuQUm/y1uXh24hTH4tJ9/ZhbWuCDb4Tfk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gseNzKS3WN6WTibDd3enDyU19sBafsflMQSmiPuuGBw=; b=Z5mgvofO/C04d8D11/knfUlEK+r9FGDu09SgK4KLkRyAvMifI7cbkwl+guH8L+OPx/ GGFUZ1wsBFmgYyqD00ctKhTaBW2cCw0l+kwbInRxprBVKKEVHuHPvbsSooCJilsGgNp5 K2n1/dmR81uk0hj1Ajk2jEgs840/C6FEq1zdKs5HAw/rBIXN1pqg3fpgfOJPmHW1ZvMX pCOqK+D+z539/A+5EVW7v+J3N963x0kt5Pd3ungpNQUWxHGpgkMW3vREHGSXLHXzv/OY H6EfmtOlqMzIHcuB46DYue5rH+eN7BgT1WcIXun02q30IJVquaCGntOY01Oz0NFISjHx R0tQ== X-Gm-Message-State: AG10YOQ5JyOJFhoTzfzL7hgDACJCNiYpO2s3QVqWphv4aWCj8ET2KvBfbEKlT+PDiwBlpsaF X-Received: by 10.28.96.198 with SMTP id u189mr4809552wmb.55.1456417531056; Thu, 25 Feb 2016 08:25:31 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id w144sm3919008wmd.8.2016.02.25.08.25.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Feb 2016 08:25:30 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, dwmw2@infradead.org, star.zeng@intel.com Date: Thu, 25 Feb 2016 17:25:27 +0100 Message-Id: <1456417527-13682-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 Cc: Ard Biesheuvel Subject: [edk2] [PATCH] MdeModulePkg: AcpiTableDxe: fix VS2008 build by merging adjacent if blocks X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 22 +++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) -- 2.5.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c index f069458b1cba..f6229ca05c10 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.