diff mbox series

[1/2] env: Don't print "Failed" error message

Message ID 20180720131421.7136-2-semen.protsenko@linaro.org
State New
Headers show
Series env: Make environment loading log more clear | expand

Commit Message

Sam Protsenko July 20, 2018, 1:14 p.m. UTC
"Failed" error message from env_load() only clutters the log with
unnecessary details, as we already have all needed warnings by that
time. Example:

    Loading Environment from FAT... MMC: no card present
    ** Bad device mmc 0 **
    Failed (-5)

Remove this "Failed" message to keep log short and clear.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
 env/env.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Wolfgang Denk July 20, 2018, 1:29 p.m. UTC | #1
Dear Sam,

In message <20180720131421.7136-2-semen.protsenko@linaro.org> you wrote:
>
> +		if (!ret)
>  			printf("OK\n");
>  
>  		if (!ret)

Now we have two "if (!ret)" in sequence.  Make this one block,
please.

Best regards,

Wolfgang Denk
Sam Protsenko July 20, 2018, 2:54 p.m. UTC | #2
On Fri, Jul 20, 2018 at 4:29 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Sam,
>
> In message <20180720131421.7136-2-semen.protsenko@linaro.org> you wrote:
>>
>> +             if (!ret)
>>                       printf("OK\n");
>>
>>               if (!ret)
>
> Now we have two "if (!ret)" in sequence.  Make this one block,
> please.
>

Good point. Will do in v2, thanks.

> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
> Commitment, n.:      Commitment can be illustrated by a breakfast
> of ham and eggs. The chicken was involved, the pig was committed.
diff mbox series

Patch

diff --git a/env/env.c b/env/env.c
index 5c0842ac07..3ab4ec4237 100644
--- a/env/env.c
+++ b/env/env.c
@@ -196,9 +196,7 @@  int env_load(void)
 
 		printf("Loading Environment from %s... ", drv->name);
 		ret = drv->load();
-		if (ret)
-			printf("Failed (%d)\n", ret);
-		else
+		if (!ret)
 			printf("OK\n");
 
 		if (!ret)