public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ravik Hasija <rahasij@linux.microsoft.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2] cmd: gpt: remove redundant print messages
Date: Wed, 31 Mar 2021 11:15:49 -0700	[thread overview]
Message-ID: <1617214549-26153-1-git-send-email-rahasij@linux.microsoft.com> (raw)
In-Reply-To: <1617140080-24756-1-git-send-email-rahasij@linux.microsoft.com>

Removing printfs from do_gpt API as the messages are generic and does not
specify error codes for failure cases.

Signed-off-by: Ravik Hasija <rahasij@linux.microsoft.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
---
Changes for v2:
  - Updated usage message for gpt read
  - Added removed printfs for write & verify
  - Rearranged verify printf
---
 cmd/gpt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmd/gpt.c b/cmd/gpt.c
index 76a95ade6c..ba0fa4c69c 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -971,9 +971,11 @@ static int do_gpt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	if ((strcmp(argv[1], "write") == 0) && (argc == 5)) {
 		printf("Writing GPT: ");
 		ret = gpt_default(blk_dev_desc, argv[4]);
+		ret ? printf("error!\n") : printf("success!\n");
 	} else if ((strcmp(argv[1], "verify") == 0)) {
-		ret = gpt_verify(blk_dev_desc, argv[4]);
 		printf("Verify GPT: ");
+		ret = gpt_verify(blk_dev_desc, argv[4]);
+		ret ? printf("error!\n") : printf("success!\n");
 	} else if ((strcmp(argv[1], "setenv") == 0)) {
 		ret = gpt_setenv(blk_dev_desc, argv[4]);
 	} else if ((strcmp(argv[1], "enumerate") == 0)) {
@@ -992,11 +994,9 @@ static int do_gpt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	}
 
 	if (ret) {
-		printf("error!\n");
 		return CMD_RET_FAILURE;
 	}
 
-	printf("success!\n");
 	return CMD_RET_SUCCESS;
 }
 
@@ -1017,7 +1017,7 @@ U_BOOT_CMD(gpt, CONFIG_SYS_MAXARGS, 1, do_gpt,
 	"      gpt_partition_name, gpt_partition_entry\n"
 	" gpt enumerate mmc 0\n"
 	"    - store list of partitions to gpt_partition_list environment variable\n"
-	" read <interface> <dev>\n"
+	" gpt read <interface> <dev>\n"
 	"    - read GPT into a data structure for manipulation\n"
 	" gpt guid <interface> <dev>\n"
 	"    - print disk GUID\n"
-- 
2.17.1

  parent reply	other threads:[~2021-03-31 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 21:34 [PATCH] cmd: gpt: remove redundant print messages Ravik Hasija
2021-03-31  8:46 ` Patrick DELAUNAY
2021-03-31 18:15 ` Ravik Hasija [this message]
2021-04-19 15:10   ` [PATCH v2] " Tom Rini

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-all 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=1617214549-26153-1-git-send-email-rahasij@linux.microsoft.com \
    --to=rahasij@linux.microsoft.com \
    --cc=u-boot@lists.denx.de \
    /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