Revision: 19411
http://sourceforge.net/p/edk2/code/19411
Author: vanjeff
Date: 2015-12-18 07:40:34 +0000 (Fri, 18 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.
(Sync patch r19233 from main trunk.)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Revision Links:
--------------
http://sourceforge.net/p/edk2/code/19233
Modified Paths:
--------------
branches/UDK2015/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
Modified: branches/UDK2015/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
===================================================================
--- branches/UDK2015/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
2015-12-18 07:40:05 UTC (rev 19410)
+++ branches/UDK2015/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
2015-12-18 07:40:34 UTC (rev 19411)
@@ -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