[RFC,05/10] env: Make the env save message a bit more explicit

Message ID 20171116092231.27740-6-maxime.ripard@free-electrons.com
State Superseded
Headers show
Series
  • env: Multiple env support and env transition for sunxi
Related show

Commit Message

Maxime Ripard Nov. 16, 2017, 9:22 a.m.
Since we'll soon have support for multiple environments, the environment
saving message might end up being printed multiple times if the higher
priority environment cannot be used.

That might confuse the user, so let's make it explicit if the operation
failed or not.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 env/env.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Lukasz Majewski Nov. 17, 2017, 9:20 a.m. | #1
On Thu, 16 Nov 2017 10:22:26 +0100
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:

> Since we'll soon have support for multiple environments, the

> environment saving message might end up being printed multiple times

> if the higher priority environment cannot be used.

> 

> That might confuse the user, so let's make it explicit if the

> operation failed or not.

> 

> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

> ---

>  env/env.c | 3 ++-

>  1 file changed, 2 insertions(+), 1 deletion(-)

> 

> diff --git a/env/env.c b/env/env.c

> index 673bfa6ba41b..1d13220aa79b 100644

> --- a/env/env.c

> +++ b/env/env.c

> @@ -131,8 +131,9 @@ int env_save(void)

>  		if (!drv->save)

>  			continue;

>  

> -		printf("Saving Environment to %s...\n", drv->name);

> +		printf("Saving Environment to %s... ", drv->name);

>  		ret = drv->save();

> +		printf("%s\n", ret ? "Failed" : "OK");

>  		if (!ret)

>  			return 0;

>  


Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

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

Patch

diff --git a/env/env.c b/env/env.c
index 673bfa6ba41b..1d13220aa79b 100644
--- a/env/env.c
+++ b/env/env.c
@@ -131,8 +131,9 @@  int env_save(void)
 		if (!drv->save)
 			continue;
 
-		printf("Saving Environment to %s...\n", drv->name);
+		printf("Saving Environment to %s... ", drv->name);
 		ret = drv->save();
+		printf("%s\n", ret ? "Failed" : "OK");
 		if (!ret)
 			return 0;