[PATCH 2/5] commands: nv: call nvvar_print() only if no argument is given
Enrico Jorns
ejo at pengutronix.de
Wed Sep 13 05:23:29 PDT 2017
Printing the nv variables (before performing any modification!) is useless
and irritating.
Signed-off-by: Enrico Jorns <ejo at pengutronix.de>
---
commands/nv.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/commands/nv.c b/commands/nv.c
index eb396bfd9b..b141198a93 100644
--- a/commands/nv.c
+++ b/commands/nv.c
@@ -44,14 +44,15 @@ static int do_nv(int argc, char *argv[])
}
}
- if (do_save)
- return nvvar_save();
-
- if (argc == optind) {
+ if (argc == 1) {
nvvar_print();
return 0;
}
+ if (do_save) {
+ return nvvar_save();
+ }
+
argc -= optind;
argv += optind;
--
2.11.0
More information about the barebox
mailing list