public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Yonghong Zhu <yonghong.zhu@intel.com>
Subject: [PATCH 6/6] MdeModulePkg CapsuleApp: Use EFI_UNSUPPORTED for incorrect Argc case
Date: Fri, 13 Jul 2018 17:08:43 +0800	[thread overview]
Message-ID: <1531472923-253528-7-git-send-email-star.zeng@intel.com> (raw)
In-Reply-To: <1531472923-253528-1-git-send-email-star.zeng@intel.com>

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>
---
 MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

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



  parent reply	other threads:[~2018-07-13  9:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13  9:08 [PATCH 0/6] CapsuleApp: Some enhancements Star Zeng
2018-07-13  9:08 ` [PATCH 1/6] MdeModulePkg CapsuleApp: Check Arg count for -P GET option Star Zeng
2018-07-13  9:08 ` [PATCH 2/6] MdeModulePkg CapsuleApp: Fix memory leak in DumpFmpImage() Star Zeng
2018-07-13  9:08 ` [PATCH 3/6] MdeModulePkg CapsuleApp: Do not parse bits in CapsuleFlags of ESRT Star Zeng
2018-07-13  9:08 ` [PATCH 4/6] MdeModulePkg CapsuleApp: Show clear message when option is unrecognized Star Zeng
2018-07-13  9:08 ` [PATCH 5/6] MdeModulePkg CapsuleApp: Check capsule header before using its Flags Star Zeng
2018-07-13  9:08 ` Star Zeng [this message]
2018-07-23  0:59 ` [PATCH 0/6] CapsuleApp: Some enhancements Yao, Jiewen
2018-07-27  1:33 ` Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1531472923-253528-7-git-send-email-star.zeng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox