Revision: 19233
          http://sourceforge.net/p/edk2/code/19233
Author:   erictian
Date:     2015-12-14 06:03:58 +0000 (Mon, 14 Dec 2015)
Log Message:
-----------
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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <[email protected]>
Reviewed-by: Feng Tian <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c

Modified: trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c 2015-12-14 
05:29:02 UTC (rev 19232)
+++ trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c 2015-12-14 
06:03:58 UTC (rev 19233)
@@ -329,6 +329,8 @@
     return FALSE;
   }
 
+  Segment = 0;
+  Bus     = 0;
   if ((AccessType == ShellMmPci) || (AccessType == ShellMmPciExpress)) {
     ShellMmDecodePciAddress ((BOOLEAN) (AccessType == ShellMmPci), Address, 
&Segment, &Bus, NULL, NULL, NULL);
   }
@@ -615,18 +617,18 @@
         // 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, 
&Buffer, TRUE, TRUE)) &&
-                   (Buffer <= mShellMmMaxNumber[Size])
-                   ) {
-          ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, Address, 
Size, &Buffer);
-        } 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, 
&Buffer, TRUE, TRUE)) &&
+                     (Buffer <= mShellMmMaxNumber[Size])
+                     ) {
+            ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, Address, 
Size, &Buffer);
+          } else {
+            ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR), 
gShellDebug1HiiHandle, L"mm");
+            continue;
+          }
         }
       }
 


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to