[PATCH] cmd: gpt: remove redundant print messages

Patrick DELAUNAY patrick.delaunay at foss.st.com
Wed Mar 31 10:46:06 CEST 2021


Hi,

On 3/30/21 11:34 PM, Ravik Hasija wrote:
> 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 at linux.microsoft.com>
> ---
>   cmd/gpt.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/cmd/gpt.c b/cmd/gpt.c
> index 76a95ade6c..2c516745b0 100644
> --- a/cmd/gpt.c
> +++ b/cmd/gpt.c
> @@ -992,11 +992,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;
>   }
>   


Before the patch the output of the gpt write command is

     printf("Writing GPT: ");

     printf("error!\n");

or

     printf("success!\n");

=> I think if you remove only the result string and "\n" it is strange...

Same for Verify with

printf("Verify GPT: ");
And the user have no more information of the command result
of the console except by testing the command result...
I think this patch should done only for few sub-command used for scripting
(gpt setenv mmc 0 $name / gpt enumerate mmc /...)
or add a quiet option (-q) to avoid any printf)
Regards
Patrick


More information about the U-Boot mailing list