diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c index 93bf4252ba..2967b0d1dd 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c @@ -70,7 +70,7 @@ DumpCapsule ( @retval EFI_UNSUPPORTED Input parameter is not valid. **/ EFI_STATUS -DmpCapsuleStatusVariable ( +DumpCapsuleStatusVariable ( VOID ); @@ -466,11 +466,13 @@ ClearCapsuleStatusVariable ( UINT32 Index; CHAR16 CapsuleVarName[20]; CHAR16 *TempVarName; + BOOLEAN Found; StrCpyS (CapsuleVarName, sizeof(CapsuleVarName)/sizeof(CapsuleVarName[0]), L"Capsule"); TempVarName = CapsuleVarName + StrLen (CapsuleVarName); Index = 0; + Found = FALSE; while (TRUE) { UnicodeSPrint (TempVarName, 5 * sizeof(CHAR16), L"%04x", Index); @@ -481,12 +483,15 @@ ClearCapsuleStatusVariable ( 0, (VOID *)NULL ); - if (EFI_ERROR(Status)) { + if (Status == EFI_NOT_FOUND) { // - // There is no capsule variables, quit + // There is no more capsule variables, quit // break; } + Found = TRUE; + + Print (L"Clear %s %r\n", CapsuleVarName, Status); Index++; if (Index > 0xFFFF) { @@ -494,6 +499,10 @@ ClearCapsuleStatusVariable ( } } + if (!Found) { + Print (L"No any Capsule#### variable found\n"); + } + return EFI_SUCCESS; } @@ -850,7 +859,7 @@ UefiMain ( return Status; } if (StrCmp(Argv[1], L"-S") == 0) { - Status = DmpCapsuleStatusVariable(); + Status = DumpCapsuleStatusVariable(); return EFI_SUCCESS; } if (StrCmp(Argv[1], L"-C") == 0) { diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c index 4c85e8c23d..11bf2e1d45 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c @@ -283,7 +283,7 @@ Done: @retval EFI_UNSUPPORTED Input parameter is not valid. **/ EFI_STATUS -DmpCapsuleStatusVariable ( +DumpCapsuleStatusVariable ( VOID ) {