From: "Gao, Liming" <liming.gao@intel.com>
To: Anthony PERARD <anthony.perard@citrix.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Laszlo Ersek <lersek@redhat.com>, "Dong, Eric" <eric.dong@intel.com>
Subject: Re: [PATCH] UefiCpuPkg/MpInitLib: Fix build of Microcode
Date: Thu, 19 Jul 2018 15:27:20 +0000 [thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2BDD0B@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20180719145825.13339-1-anthony.perard@citrix.com>
Edk2 style doesn't initialize the local variable value in its declaration. Could you update this patch to separately set ProcessorFlags value?
Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Anthony PERARD
> Sent: Thursday, July 19, 2018 10:58 PM
> To: edk2-devel@lists.01.org
> Cc: Anthony PERARD <anthony.perard@citrix.com>; Laszlo Ersek <lersek@redhat.com>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2] [PATCH] UefiCpuPkg/MpInitLib: Fix build of Microcode
>
> On Debian Jessie, this fail to build with:
>
> /build/UefiCpuPkg/Library/MpInitLib/Microcode.c: In function 'MicrocodeDetect':
> /build/UefiCpuPkg/Library/MpInitLib/Microcode.c:248:37: error: 'ProcessorFlags' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
> CpuMpData->ProcessorFlags = ProcessorFlags;
> ^
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
> UefiCpuPkg/Library/MpInitLib/Microcode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> index efda143e67..60cf8bf409 100644
> --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> @@ -60,7 +60,7 @@ MicrocodeDetect (
> BOOLEAN CorrectMicrocode;
> VOID *MicrocodeData;
> MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;
> - UINT32 ProcessorFlags;
> + UINT32 ProcessorFlags = 0;
> UINT32 ThreadId;
>
> if (CpuMpData->MicrocodePatchRegionSize == 0) {
> --
> Anthony PERARD
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
next prev parent reply other threads:[~2018-07-19 15:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 14:58 [PATCH] UefiCpuPkg/MpInitLib: Fix build of Microcode Anthony PERARD
2018-07-19 15:27 ` Gao, Liming [this message]
2018-07-19 15:52 ` [PATCH v2] " Anthony PERARD
2018-07-19 18:32 ` Laszlo Ersek
2018-07-20 9:42 ` Anthony PERARD
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=4A89E2EF3DFEDB4C8BFDE51014F606A14E2BDD0B@SHSMSX104.ccr.corp.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