diff options
author | Michael Kinney <michael.d.kinney@intel.com> | 2015-12-18 07:40:34 +0000 |
---|---|---|
committer | vanjeff <vanjeff@Edk2> | 2015-12-18 07:40:34 +0000 |
commit | a672cba6b879a6c7a30b05a0ee48d5bdc771554f (patch) | |
tree | eb236d2e8bdbedbc1bdbf6b8176baaf224fa935c /ShellPkg/Library/UefiShellDebug1CommandsLib | |
parent | bd3445a74754f3eeda9d2f2cc89803c27f046531 (diff) | |
download | edk2-platforms-a672cba6b879a6c7a30b05a0ee48d5bdc771554f.tar.xz |
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 <michael.d.kinney@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19411 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib')
-rw-r--r-- | ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c index 7b26e4d27f..26a758b6cd 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c @@ -329,6 +329,8 @@ ShellMmLocateIoProtocol ( 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 @@ 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, &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;
+ }
}
}
|