From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: Void lookup limit of 2 exceeded) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4ECC62035BB39 for ; Tue, 21 Nov 2017 17:59:19 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2017 18:03:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,435,1505804400"; d="scan'208";a="5595599" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga001.fm.intel.com with ESMTP; 21 Nov 2017 18:03:33 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Ruiyu Ni Date: Wed, 22 Nov 2017 10:02:20 +0800 Message-Id: <1511316140-12868-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [patch] PcAtChipsetPkg/IsaAcpiDxe: Fix VS2012 build failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 01:59:19 -0000 Done: if (EFI_ERROR (Status)) { if (PciIo != NULL && Enabled) { PciIo->Attributes ( PciIo, EfiPciIoAttributeOperationSet, OriginalAttributes, NULL ); } } In above codes, VS2012/VS2010 will report that "OriginalAttributes" will be used without initialization. But in fact, when the if expression is true(if (PciIo != NULL && Enabled)), the "OriginalAttributes" must be initialized. In order to fix this false positive issue, we initialize the "OriginalAttributes" after declaration. Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c b/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c index d82e2c4..c7ea559 100644 --- a/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c +++ b/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c @@ -176,10 +176,11 @@ PcatIsaAcpiDriverBindingStart ( BOOLEAN Enabled; Enabled = FALSE; Supports = 0; PcatIsaAcpiDev = NULL; + OriginalAttributes = 0; // // Open the PCI I/O Protocol Interface // PciIo = NULL; Status = gBS->OpenProtocol ( -- 1.9.5.msysgit.1