Cc: Michael D Kinney <michael.d.kin...@intel.com> Cc: Jiewen Yao <jiewen....@intel.com> Cc: Yonghong Zhu <yonghong....@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.z...@intel.com> --- MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 17 +++++++++++++---- MdeModulePkg/Application/CapsuleApp/CapsuleDump.c | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c index 93bf4252bac6..2967b0d1dd18 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 4c85e8c23dff..11bf2e1d4530 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 ) { -- 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel