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:[email protected]] On Behalf Of > Anthony PERARD > Sent: Thursday, July 19, 2018 10:58 PM > To: [email protected] > Cc: Anthony PERARD <[email protected]>; Laszlo Ersek > <[email protected]>; Dong, Eric <[email protected]> > 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 <[email protected]> > --- > 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 > [email protected] > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

