public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable
@ 2017-12-12  3:28 Jian J Wang
  2017-12-12  3:42 ` Dong, Eric
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jian J Wang @ 2017-12-12  3:28 UTC (permalink / raw)
  To: edk2-devel; +Cc: Eric Dong, Wu Hao

The purpose of the patch is just to avoid complaining from compiler and
static check tool.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Wu Hao <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 UefiCpuPkg/CpuDxe/CpuMp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c
index 56ba026152..61018c9950 100644
--- a/UefiCpuPkg/CpuDxe/CpuMp.c
+++ b/UefiCpuPkg/CpuDxe/CpuMp.c
@@ -695,6 +695,8 @@ InitializeMpExceptionStackSwitchHandlers (
   EssData.Ia32.StackSwitchExceptionNumber = ExceptionNumber;
   EssData.Ia32.KnownGoodStackSize = FixedPcdGet32(PcdCpuKnownGoodStackSize);
 
+  Gdtr.Base = 0;
+  Gdtr.Limit = 0;
   MpInitLibWhoAmI (&Bsp);
   for (Index = 0; Index < mNumberOfProcessors; ++Index) {
     //
-- 
2.15.1.windows.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable
  2017-12-12  3:28 [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable Jian J Wang
@ 2017-12-12  3:42 ` Dong, Eric
  2017-12-12  8:25 ` Wu, Hao A
  2017-12-12  9:27 ` Laszlo Ersek
  2 siblings, 0 replies; 5+ messages in thread
From: Dong, Eric @ 2017-12-12  3:42 UTC (permalink / raw)
  To: Wang, Jian J, edk2-devel@lists.01.org; +Cc: Wu, Hao A

Reviewed-by: Eric Dong <eric.dong@intel.com>

-----Original Message-----
From: Wang, Jian J 
Sent: Tuesday, December 12, 2017 11:28 AM
To: edk2-devel@lists.01.org
Cc: Dong, Eric; Wu, Hao A
Subject: [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable

The purpose of the patch is just to avoid complaining from compiler and static check tool.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Wu Hao <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 UefiCpuPkg/CpuDxe/CpuMp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 56ba026152..61018c9950 100644
--- a/UefiCpuPkg/CpuDxe/CpuMp.c
+++ b/UefiCpuPkg/CpuDxe/CpuMp.c
@@ -695,6 +695,8 @@ InitializeMpExceptionStackSwitchHandlers (
   EssData.Ia32.StackSwitchExceptionNumber = ExceptionNumber;
   EssData.Ia32.KnownGoodStackSize = FixedPcdGet32(PcdCpuKnownGoodStackSize);
 
+  Gdtr.Base = 0;
+  Gdtr.Limit = 0;
   MpInitLibWhoAmI (&Bsp);
   for (Index = 0; Index < mNumberOfProcessors; ++Index) {
     //
--
2.15.1.windows.2



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable
  2017-12-12  3:28 [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable Jian J Wang
  2017-12-12  3:42 ` Dong, Eric
@ 2017-12-12  8:25 ` Wu, Hao A
  2017-12-12  9:27 ` Laszlo Ersek
  2 siblings, 0 replies; 5+ messages in thread
From: Wu, Hao A @ 2017-12-12  8:25 UTC (permalink / raw)
  To: Wang, Jian J, edk2-devel@lists.01.org; +Cc: Dong, Eric

Reviewed-by: Hao Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> -----Original Message-----
> From: Wang, Jian J
> Sent: Tuesday, December 12, 2017 11:28 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Wu, Hao A
> Subject: [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable
> 
> The purpose of the patch is just to avoid complaining from compiler and
> static check tool.
> 
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Wu Hao <hao.a.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> ---
>  UefiCpuPkg/CpuDxe/CpuMp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c
> index 56ba026152..61018c9950 100644
> --- a/UefiCpuPkg/CpuDxe/CpuMp.c
> +++ b/UefiCpuPkg/CpuDxe/CpuMp.c
> @@ -695,6 +695,8 @@ InitializeMpExceptionStackSwitchHandlers (
>    EssData.Ia32.StackSwitchExceptionNumber = ExceptionNumber;
>    EssData.Ia32.KnownGoodStackSize =
> FixedPcdGet32(PcdCpuKnownGoodStackSize);
> 
> +  Gdtr.Base = 0;
> +  Gdtr.Limit = 0;
>    MpInitLibWhoAmI (&Bsp);
>    for (Index = 0; Index < mNumberOfProcessors; ++Index) {
>      //
> --
> 2.15.1.windows.2



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable
  2017-12-12  3:28 [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable Jian J Wang
  2017-12-12  3:42 ` Dong, Eric
  2017-12-12  8:25 ` Wu, Hao A
@ 2017-12-12  9:27 ` Laszlo Ersek
  2017-12-13  0:16   ` Wang, Jian J
  2 siblings, 1 reply; 5+ messages in thread
From: Laszlo Ersek @ 2017-12-12  9:27 UTC (permalink / raw)
  To: Jian J Wang, edk2-devel; +Cc: Wu Hao, Eric Dong

Hello Jian,

On 12/12/17 04:28, Jian J Wang wrote:
> The purpose of the patch is just to avoid complaining from compiler and
> static check tool.
> 
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Wu Hao <hao.a.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> ---
>  UefiCpuPkg/CpuDxe/CpuMp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c
> index 56ba026152..61018c9950 100644
> --- a/UefiCpuPkg/CpuDxe/CpuMp.c
> +++ b/UefiCpuPkg/CpuDxe/CpuMp.c
> @@ -695,6 +695,8 @@ InitializeMpExceptionStackSwitchHandlers (
>    EssData.Ia32.StackSwitchExceptionNumber = ExceptionNumber;
>    EssData.Ia32.KnownGoodStackSize = FixedPcdGet32(PcdCpuKnownGoodStackSize);
>  
> +  Gdtr.Base = 0;
> +  Gdtr.Limit = 0;
>    MpInitLibWhoAmI (&Bsp);
>    for (Index = 0; Index < mNumberOfProcessors; ++Index) {
>      //
> 

(1) Please add a separate comment, in the style that is described in
<https://bugzilla.tianocore.org/show_bug.cgi?id=607>:

  //
  // set Gdtr to suppress incorrect compiler/analyzer warnings
  //
  Gdtr.Base = 0;
  Gdtr.Limit = 0;


(2) I suggest updating the subject line like this:

UefiCpuPkg/CpuDxe: suppress invalid warning about uninitialized variable

(72 characters)

With those changes:

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks!
Laszlo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable
  2017-12-12  9:27 ` Laszlo Ersek
@ 2017-12-13  0:16   ` Wang, Jian J
  0 siblings, 0 replies; 5+ messages in thread
From: Wang, Jian J @ 2017-12-13  0:16 UTC (permalink / raw)
  To: Laszlo Ersek, edk2-devel@lists.01.org; +Cc: Wu, Hao A, Dong, Eric

Got it. Thanks for the feedback.

Regards,
Jian

> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Tuesday, December 12, 2017 5:27 PM
> To: Wang, Jian J <jian.j.wang@intel.com>; edk2-devel@lists.01.org
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>
> Subject: Re: [edk2] [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local
> variable
> 
> Hello Jian,
> 
> On 12/12/17 04:28, Jian J Wang wrote:
> > The purpose of the patch is just to avoid complaining from compiler and
> > static check tool.
> >
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Wu Hao <hao.a.wu@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> > ---
> >  UefiCpuPkg/CpuDxe/CpuMp.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c
> > index 56ba026152..61018c9950 100644
> > --- a/UefiCpuPkg/CpuDxe/CpuMp.c
> > +++ b/UefiCpuPkg/CpuDxe/CpuMp.c
> > @@ -695,6 +695,8 @@ InitializeMpExceptionStackSwitchHandlers (
> >    EssData.Ia32.StackSwitchExceptionNumber = ExceptionNumber;
> >    EssData.Ia32.KnownGoodStackSize =
> FixedPcdGet32(PcdCpuKnownGoodStackSize);
> >
> > +  Gdtr.Base = 0;
> > +  Gdtr.Limit = 0;
> >    MpInitLibWhoAmI (&Bsp);
> >    for (Index = 0; Index < mNumberOfProcessors; ++Index) {
> >      //
> >
> 
> (1) Please add a separate comment, in the style that is described in
> <https://bugzilla.tianocore.org/show_bug.cgi?id=607>:
> 
>   //
>   // set Gdtr to suppress incorrect compiler/analyzer warnings
>   //
>   Gdtr.Base = 0;
>   Gdtr.Limit = 0;
> 
> 
> (2) I suggest updating the subject line like this:
> 
> UefiCpuPkg/CpuDxe: suppress invalid warning about uninitialized variable
> 
> (72 characters)
> 
> With those changes:
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 
> Thanks!
> Laszlo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-13  0:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12  3:28 [PATCH] UefiCpuPkg/CpuDxe: Add initialization to local variable Jian J Wang
2017-12-12  3:42 ` Dong, Eric
2017-12-12  8:25 ` Wu, Hao A
2017-12-12  9:27 ` Laszlo Ersek
2017-12-13  0:16   ` Wang, Jian J

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox