From nobody Sat Nov 2 10:19:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1491354424360950.2176335576144; Tue, 4 Apr 2017 18:07:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 354C4219392F8; Tue, 4 Apr 2017 18:07:02 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 21597219392ED for ; Tue, 4 Apr 2017 18:07:01 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2017 18:07:00 -0700 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga003.jf.intel.com with ESMTP; 04 Apr 2017 18:06:59 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491354421; x=1522890421; h=from:to:cc:subject:date:message-id; bh=oZDpvdBVOU51oWe65LJt+9Fqa/6P3Arw8v7lDMWu9fo=; b=KuEcaVv+F/beQZbku/Ior+FDl6cc27F2/zkRbx567u6tCF/cP2XMYbDU N5Kbyaq+iofrYyNbAfKnR8N1tJt1Ag==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,276,1486454400"; d="scan'208";a="951917152" From: Dandan Bi To: edk2-devel@lists.01.org Date: Wed, 5 Apr 2017 09:06:33 +0800 Message-Id: <1491354393-115588-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [patch] UefiCpuPkg/MtrrLib: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: , Cc: Ruiyu Ni , Jeff Fan MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Ruiyu Ni Cc: Jeff Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Ruiyu Ni --- UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/Mtrr= Lib/MtrrLib.c index 8e84272..c38191a 100644 --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c @@ -700,10 +700,11 @@ MtrrLibGetPositiveMtrrNumber ( UINT64 SubLength; UINT32 MtrrNumber; BOOLEAN UseLeastAlignment; =20 UseLeastAlignment =3D TRUE; + SubLength =3D 0; =20 // // Calculate the alignment of the base address. // for (MtrrNumber =3D 0; Length !=3D 0; MtrrNumber++) { @@ -852,10 +853,11 @@ MtrrLibGetMtrrNumber ( UINT32 Index; =20 *SubLeft =3D 0; *SubRight =3D 0; LeastSubtractiveMtrrNumber =3D 0; + BaseAlignment =3D 0; =20 // // Get the optimal left subtraction solution. // if (BaseAddress !=3D 0) { @@ -1625,10 +1627,12 @@ MtrrLibSetMemoryAttributeInVariableMtrr ( UINT32 MtrrNumber; UINT32 SubtractiveLeft; UINT32 SubtractiveRight; BOOLEAN UseLeastAlignment; =20 + Alignment =3D 0; + MtrrNumber =3D MtrrLibGetMtrrNumber (Ranges, RangeCount, VariableMtrr, *= VariableMtrrCount, BaseAddress, Length, Type, Alignment0= , &SubtractiveLeft, &SubtractiveRight); =20 if (MtrrNumber + *VariableMtrrCount > VariableMtrrCapacity) { return RETURN_OUT_OF_RESOURCES; --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel