public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Eric Dong <eric.dong@intel.com>
To: edk2-devel@lists.01.org
Cc: Ruiyu Ni <ruiyu.ni@intel.com>, Laszlo Ersek <lersek@redhat.com>,
	Dandan Bi <dandan.bi@intel.com>
Subject: [Patch 1/6] UefiCpuPkg/RegisterCpuFeaturesLib: Fix build failure for VS2012 and GCC49.
Date: Thu, 25 Oct 2018 10:25:56 +0800	[thread overview]
Message-ID: <20181025022601.25136-2-eric.dong@intel.com> (raw)
In-Reply-To: <20181025022601.25136-1-eric.dong@intel.com>

Code initialized in function can't be correctly detected by build tool.
Add code to clearly initialize the local variable before use it.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
---
 UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index 7a5939c966..173f2edbea 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -1029,6 +1029,7 @@ SetProcessorRegister (
 
   InitApicId = GetInitialApicId ();
   RegisterTable = NULL;
+  ProcIndex = (UINTN)-1;
   for (Index = 0; Index < AcpiCpuData->NumberOfCpus; Index++) {
     if (RegisterTables[Index].InitialApicId == InitApicId) {
       RegisterTable =  &RegisterTables[Index];
-- 
2.15.0.windows.1



  reply	other threads:[~2018-10-25  2:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25  2:25 [Patch 0/6] Fix coding style issues Eric Dong
2018-10-25  2:25 ` Eric Dong [this message]
2018-10-25  2:25 ` [Patch 2/6] UefiCpuPkg/CpuCommonFeaturesLib: Remove white space at line end Eric Dong
2018-10-25  2:25 ` [Patch 3/6] UefiCpuPkg/RegisterCpuFeaturesLib: Fix ECC issues Eric Dong
2018-10-25  2:25 ` [Patch 4/6] UefiCpuPkg/PiSmmCpuDxeSmm: Remove white space at line end Eric Dong
2018-10-25  2:26 ` [Patch 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Clean up useless code Eric Dong
2018-10-25  5:50   ` Ni, Ruiyu
2018-10-25  2:26 ` [Patch 6/6] UefiCpuPkg/PiSmmCpuDxeSmm: Fix build failure for VS2012 and GCC49 Eric Dong
2018-10-25  5:50 ` [Patch 0/6] Fix coding style issues Ni, Ruiyu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181025022601.25136-2-eric.dong@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox