MdeModulePkg CapsuleApp: Use EFI_UNSUPPORTED for incorrect Argc case
authorStar Zeng <star.zeng@intel.com>
Fri, 13 Jul 2018 08:00:15 +0000 (16:00 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 23 Jul 2018 01:17:39 +0000 (09:17 +0800)
Align code to use EFI_UNSUPPORTED for all incorrect Argc cases.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Application/CapsuleApp/CapsuleApp.c

index dbcffdd..df5de91 100644 (file)
@@ -193,7 +193,7 @@ CreateBmpFmp (
   // VerticalResolution   >= BMP_IMAGE_HEADER.PixelHeight\r
 \r
   if (Argc != 5) {\r
-    Print(L"CapsuleApp: Invalid Parameter.\n");\r
+    Print(L"CapsuleApp: Incorrect parameter count.\n");\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -387,7 +387,7 @@ CreateNestedFmp (
   EFI_STATUS                                    Status;\r
 \r
   if (Argc != 5) {\r
-    Print(L"CapsuleApp: Invalid Parameter.\n");\r
+    Print(L"CapsuleApp: Incorrect parameter count.\n");\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -793,7 +793,8 @@ PrintUsage (
   @param[in]  SystemTable     The system table.\r
 \r
   @retval EFI_SUCCESS            Command completed successfully.\r
-  @retval EFI_INVALID_PARAMETER  Command usage error.\r
+  @retval EFI_UNSUPPORTED        Command usage unsupported.\r
+  @retval EFI_INVALID_PARAMETER  Command usage invalid.\r
   @retval EFI_NOT_FOUND          The input file can't be found.\r
 **/\r
 EFI_STATUS\r
@@ -824,12 +825,12 @@ UefiMain (
   }\r
   if (Argc < 2) {\r
     PrintUsage();\r
-    return EFI_INVALID_PARAMETER;\r
+    return EFI_UNSUPPORTED;\r
   }\r
   if (StrCmp(Argv[1], L"-D") == 0) {\r
-    if (Argc < 3) {\r
-      Print(L"CapsuleApp: NO input capsule name.\n");\r
-      return EFI_INVALID_PARAMETER;\r
+    if (Argc != 3) {\r
+      Print(L"CapsuleApp: Incorrect parameter count.\n");\r
+      return EFI_UNSUPPORTED;\r
     }\r
     Status = DumpCapsule(Argv[2]);\r
     return Status;\r