Re: [edk2] [Patch] ShellPkg/Mm: Fix build warnings

2015-12-14 Thread Carsey, Jaben
Mike,

Your second patch needs to be rebased.  This is changing some of the lines that 
were changed with the most recent patch to this file.

-Jaben

> -Original Message-
> From: Kinney, Michael D
> Sent: Saturday, December 12, 2015 1:50 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Carsey, Jaben 
> Subject: [Patch] ShellPkg/Mm: Fix build warnings
> Importance: High
> 
> Fix build warnings for potentially uninitialized local variables
> in the functions ShellMmLocateIoProtocol() and ShellCommandRunMm()
> in the Shell implementation of the 'mm' command.
> 
> Cc: Ruiyu Ni 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Michael Kinney 
> ---
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c | 24 +-
> --
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> index 3f08cc8..1e2c0cb 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> @@ -328,6 +328,8 @@ ShellMmLocateIoProtocol (
>  return FALSE;
>}
> 
> +  Segment = 0;
> +  Bus = 0;
>if ((AccessType == ShellMmPci) || (AccessType == ShellMmPciExpress)) {
>  ShellMmDecodePciAddress ((BOOLEAN) (AccessType == ShellMmPci),
> Address, , , NULL, NULL, NULL);
>}
> @@ -614,18 +616,18 @@ ShellCommandRunMm (
>  // skip space characters
>  //
>  for (Index = 0; InputStr[Index] == ' '; Index++);
> -  }
> 
> -  if ((InputStr != NULL) && (InputStr[Index] != CHAR_NULL)) {
> -if ((InputStr[Index] == '.') || (InputStr[Index] == 'q') || 
> (InputStr[Index] ==
> 'Q')) {
> -  Complete = TRUE;
> -} else if (!EFI_ERROR (ShellConvertStringToUint64 (InputStr + Index,
> , TRUE, TRUE)) &&
> -   (Buffer <= mShellMmMaxNumber[Size])
> -   ) {
> -  ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, Address,
> Size, );
> -} else {
> -  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR),
> gShellDebug1HiiHandle, L"mm");
> -  continue;
> +if ((InputStr[Index] != CHAR_NULL)) {
> +  if ((InputStr[Index] == '.') || (InputStr[Index] == 'q') || 
> (InputStr[Index]
> == 'Q')) {
> +Complete = TRUE;
> +  } else if (!EFI_ERROR (ShellConvertStringToUint64 (InputStr + 
> Index,
> , TRUE, TRUE)) &&
> + (Buffer <= mShellMmMaxNumber[Size])
> + ) {
> +ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, 
> Address,
> Size, );
> +  } else {
> +ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR),
> gShellDebug1HiiHandle, L"mm");
> +continue;
> +  }
>  }
>}
> 
> --
> 2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] ShellPkg/Mm: Fix build warnings

2015-12-14 Thread Carsey, Jaben
Looks good.  Thanks!

> -Original Message-
> From: Kinney, Michael D
> Sent: Monday, December 14, 2015 10:14 AM
> To: Carsey, Jaben ; edk2-devel@lists.01.org; Kinney,
> Michael D 
> Cc: Ni, Ruiyu 
> Subject: RE: [Patch] ShellPkg/Mm: Fix build warnings
> Importance: High
> 
> Jaben,
> 
> Eric Tian made the commit.  Can you please verify that it was rebased 
> correctly.
> 
> Thanks,
> 
> Mike
> 
> > -Original Message-
> > From: Carsey, Jaben
> > Sent: Monday, December 14, 2015 8:12 AM
> > To: Kinney, Michael D ; edk2-
> > de...@lists.01.org
> > Cc: Ni, Ruiyu ; Carsey, Jaben
> > 
> > Subject: RE: [Patch] ShellPkg/Mm: Fix build warnings
> >
> > Mike,
> >
> > Your second patch needs to be rebased.  This is changing some of
> > the lines that were changed with the most recent patch to this
> > file.
> >
> > -Jaben
> >
> > > -Original Message-
> > > From: Kinney, Michael D
> > > Sent: Saturday, December 12, 2015 1:50 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Ni, Ruiyu ; Carsey, Jaben
> > 
> > > Subject: [Patch] ShellPkg/Mm: Fix build warnings
> > > Importance: High
> > >
> > > Fix build warnings for potentially uninitialized local
> > variables
> > > in the functions ShellMmLocateIoProtocol() and
> > ShellCommandRunMm()
> > > in the Shell implementation of the 'mm' command.
> > >
> > > Cc: Ruiyu Ni 
> > > Cc: Jaben Carsey 
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Michael Kinney 
> > > ---
> > >  ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c | 24
> > +-
> > > --
> > >  1 file changed, 13 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > > index 3f08cc8..1e2c0cb 100644
> > > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > > @@ -328,6 +328,8 @@ ShellMmLocateIoProtocol (
> > >  return FALSE;
> > >}
> > >
> > > +  Segment = 0;
> > > +  Bus = 0;
> > >if ((AccessType == ShellMmPci) || (AccessType ==
> > ShellMmPciExpress)) {
> > >  ShellMmDecodePciAddress ((BOOLEAN) (AccessType ==
> > ShellMmPci),
> > > Address, , , NULL, NULL, NULL);
> > >}
> > > @@ -614,18 +616,18 @@ ShellCommandRunMm (
> > >  // skip space characters
> > >  //
> > >  for (Index = 0; InputStr[Index] == ' '; Index++);
> > > -  }
> > >
> > > -  if ((InputStr != NULL) && (InputStr[Index] !=
> > CHAR_NULL)) {
> > > -if ((InputStr[Index] == '.') || (InputStr[Index] ==
> > 'q') || (InputStr[Index] ==
> > > 'Q')) {
> > > -  Complete = TRUE;
> > > -} else if (!EFI_ERROR (ShellConvertStringToUint64
> > (InputStr + Index,
> > > , TRUE, TRUE)) &&
> > > -   (Buffer <= mShellMmMaxNumber[Size])
> > > -   ) {
> > > -  ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo,
> > FALSE, Address,
> > > Size, );
> > > -} else {
> > > -  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> > (STR_MM_ERROR),
> > > gShellDebug1HiiHandle, L"mm");
> > > -  continue;
> > > +if ((InputStr[Index] != CHAR_NULL)) {
> > > +  if ((InputStr[Index] == '.') || (InputStr[Index] ==
> > 'q') || (InputStr[Index]
> > > == 'Q')) {
> > > +Complete = TRUE;
> > > +  } else if (!EFI_ERROR (ShellConvertStringToUint64
> > (InputStr + Index,
> > > , TRUE, TRUE)) &&
> > > + (Buffer <= mShellMmMaxNumber[Size])
> > > + ) {
> > > +ShellMmAccess (AccessType, PciRootBridgeIo,
> > CpuIo, FALSE, Address,
> > > Size, );
> > > +  } else {
> > > +ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> > (STR_MM_ERROR),
> > > gShellDebug1HiiHandle, L"mm");
> > > +continue;
> > > +  }
> > >  }
> > >}
> > >
> > > --
> > > 2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] ShellPkg/Mm: Fix build warnings

2015-12-14 Thread Kinney, Michael D
Jaben,

Eric Tian made the commit.  Can you please verify that it was rebased correctly.

Thanks,

Mike

> -Original Message-
> From: Carsey, Jaben
> Sent: Monday, December 14, 2015 8:12 AM
> To: Kinney, Michael D ; edk2-
> de...@lists.01.org
> Cc: Ni, Ruiyu ; Carsey, Jaben
> 
> Subject: RE: [Patch] ShellPkg/Mm: Fix build warnings
> 
> Mike,
> 
> Your second patch needs to be rebased.  This is changing some of
> the lines that were changed with the most recent patch to this
> file.
> 
> -Jaben
> 
> > -Original Message-
> > From: Kinney, Michael D
> > Sent: Saturday, December 12, 2015 1:50 PM
> > To: edk2-devel@lists.01.org
> > Cc: Ni, Ruiyu ; Carsey, Jaben
> 
> > Subject: [Patch] ShellPkg/Mm: Fix build warnings
> > Importance: High
> >
> > Fix build warnings for potentially uninitialized local
> variables
> > in the functions ShellMmLocateIoProtocol() and
> ShellCommandRunMm()
> > in the Shell implementation of the 'mm' command.
> >
> > Cc: Ruiyu Ni 
> > Cc: Jaben Carsey 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Michael Kinney 
> > ---
> >  ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c | 24
> +-
> > --
> >  1 file changed, 13 insertions(+), 11 deletions(-)
> >
> > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > index 3f08cc8..1e2c0cb 100644
> > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > @@ -328,6 +328,8 @@ ShellMmLocateIoProtocol (
> >  return FALSE;
> >}
> >
> > +  Segment = 0;
> > +  Bus = 0;
> >if ((AccessType == ShellMmPci) || (AccessType ==
> ShellMmPciExpress)) {
> >  ShellMmDecodePciAddress ((BOOLEAN) (AccessType ==
> ShellMmPci),
> > Address, , , NULL, NULL, NULL);
> >}
> > @@ -614,18 +616,18 @@ ShellCommandRunMm (
> >  // skip space characters
> >  //
> >  for (Index = 0; InputStr[Index] == ' '; Index++);
> > -  }
> >
> > -  if ((InputStr != NULL) && (InputStr[Index] !=
> CHAR_NULL)) {
> > -if ((InputStr[Index] == '.') || (InputStr[Index] ==
> 'q') || (InputStr[Index] ==
> > 'Q')) {
> > -  Complete = TRUE;
> > -} else if (!EFI_ERROR (ShellConvertStringToUint64
> (InputStr + Index,
> > , TRUE, TRUE)) &&
> > -   (Buffer <= mShellMmMaxNumber[Size])
> > -   ) {
> > -  ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo,
> FALSE, Address,
> > Size, );
> > -} else {
> > -  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> (STR_MM_ERROR),
> > gShellDebug1HiiHandle, L"mm");
> > -  continue;
> > +if ((InputStr[Index] != CHAR_NULL)) {
> > +  if ((InputStr[Index] == '.') || (InputStr[Index] ==
> 'q') || (InputStr[Index]
> > == 'Q')) {
> > +Complete = TRUE;
> > +  } else if (!EFI_ERROR (ShellConvertStringToUint64
> (InputStr + Index,
> > , TRUE, TRUE)) &&
> > + (Buffer <= mShellMmMaxNumber[Size])
> > + ) {
> > +ShellMmAccess (AccessType, PciRootBridgeIo,
> CpuIo, FALSE, Address,
> > Size, );
> > +  } else {
> > +ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> (STR_MM_ERROR),
> > gShellDebug1HiiHandle, L"mm");
> > +continue;
> > +  }
> >  }
> >}
> >
> > --
> > 2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] ShellPkg/Mm: Fix build warnings

2015-12-13 Thread Tian, Feng
On behalf of Ray. Reviewed-by: Feng Tian 

Same again, I will help commit it.

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Michael 
Kinney
Sent: Sunday, December 13, 2015 05:50
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu; Carsey, Jaben
Subject: [edk2] [Patch] ShellPkg/Mm: Fix build warnings

Fix build warnings for potentially uninitialized local variables in the 
functions ShellMmLocateIoProtocol() and ShellCommandRunMm() in the Shell 
implementation of the 'mm' command.

Cc: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney 
---
 ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
index 3f08cc8..1e2c0cb 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
@@ -328,6 +328,8 @@ ShellMmLocateIoProtocol (
 return FALSE;
   }
 
+  Segment = 0;
+  Bus = 0;
   if ((AccessType == ShellMmPci) || (AccessType == ShellMmPciExpress)) {
 ShellMmDecodePciAddress ((BOOLEAN) (AccessType == ShellMmPci), Address, 
, , NULL, NULL, NULL);
   }
@@ -614,18 +616,18 @@ ShellCommandRunMm (
 // skip space characters
 //
 for (Index = 0; InputStr[Index] == ' '; Index++);
-  }
 
-  if ((InputStr != NULL) && (InputStr[Index] != CHAR_NULL)) {
-if ((InputStr[Index] == '.') || (InputStr[Index] == 'q') || 
(InputStr[Index] == 'Q')) {
-  Complete = TRUE;
-} else if (!EFI_ERROR (ShellConvertStringToUint64 (InputStr + Index, 
, TRUE, TRUE)) &&
-   (Buffer <= mShellMmMaxNumber[Size])
-   ) {
-  ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, Address, 
Size, );
-} else {
-  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR), 
gShellDebug1HiiHandle, L"mm");
-  continue;
+if ((InputStr[Index] != CHAR_NULL)) {
+  if ((InputStr[Index] == '.') || (InputStr[Index] == 'q') || 
(InputStr[Index] == 'Q')) {
+Complete = TRUE;
+  } else if (!EFI_ERROR (ShellConvertStringToUint64 (InputStr + Index, 
, TRUE, TRUE)) &&
+ (Buffer <= mShellMmMaxNumber[Size])
+ ) {
+ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, Address, 
Size, );
+  } else {
+ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR), 
gShellDebug1HiiHandle, L"mm");
+continue;
+  }
 }
   }
 
--
2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel