From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: eric.dong@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Tue, 16 Jul 2019 20:26:15 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2019 20:26:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,272,1559545200"; d="scan'208";a="175588993" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jul 2019 20:26:14 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 16 Jul 2019 20:26:14 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 16 Jul 2019 20:26:14 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 16 Jul 2019 20:26:14 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.3]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.55]) with mapi id 14.03.0439.000; Wed, 17 Jul 2019 11:26:12 +0800 From: "Dong, Eric" To: "Zeng, Star" , "devel@edk2.groups.io" CC: Laszlo Ersek , "Ni, Ray" , "Bi, Dandan" Subject: Re: [PATCH] UefiCpuPkg DxeRegisterCpuFeaturesLib: Fix VS2012 build failure Thread-Topic: [PATCH] UefiCpuPkg DxeRegisterCpuFeaturesLib: Fix VS2012 build failure Thread-Index: AQHVPE8A2zRuAUd49kCbLEnaP4MlWabOJg8g Date: Wed, 17 Jul 2019 03:26:11 +0000 Message-ID: References: <20190717032314.25408-1-star.zeng@intel.com> In-Reply-To: <20190717032314.25408-1-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Zeng, Star > Sent: Wednesday, July 17, 2019 11:23 AM > To: devel@edk2.groups.io > Cc: Zeng, Star ; Laszlo Ersek ; > Dong, Eric ; Ni, Ray ; Bi, Dandan > > Subject: [PATCH] UefiCpuPkg DxeRegisterCpuFeaturesLib: Fix VS2012 build > failure >=20 > The new VS2012 build failure is caused by 7a0df26. >=20 > xxx\registercpufeatureslib\dxeregistercpufeatureslib.c(258) : > warning C4701: potentially uninitialized local variable 'MpEvent' used >=20 > It is a false positive alarm. > MpEvent is assigned at line 238 and will be used at line 258, both lines = are > controlled by "if (CpuFeaturesData->NumberOfCpus > 1)". >=20 > This patch initializes MpEvent to suppress incorrect compiler/analyzer > warnings. >=20 > Cc: Laszlo Ersek > Cc: Eric Dong > Cc: Ray Ni > Cc: Dandan Bi > Signed-off-by: Star Zeng > --- > .../RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c > index ffd99046a6cd..f87b2892aaae 100644 > --- > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c > +++ > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLi > +++ b.c > @@ -229,6 +229,12 @@ CpuFeaturesInitialize ( > OldBspNumber =3D GetProcessorIndex (CpuFeaturesData); > CpuFeaturesData->BspNumber =3D OldBspNumber; >=20 > + // > + // > + // Initialize MpEvent to suppress incorrect compiler/analyzer warnings= . > + // > + MpEvent =3D NULL; > + > if (CpuFeaturesData->NumberOfCpus > 1) { > Status =3D gBS->CreateEvent ( > EVT_NOTIFY_WAIT, > -- > 2.21.0.windows.1