[PATCH 2/5] commands: nv: call nvvar_print() only if no argument is given
Enrico Jorns
ejo at pengutronix.de
Mon Oct 30 03:34:18 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 1c5514dd32..2ee18187e0 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