From f1ee2ff63058b96c89669581fe8058923ae7dd67 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 3 Mar 2026 15:56:06 +0000 Subject: util/nvmutil: tidy up set_cmd reduced indentation Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'util/nvmutil') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 662204fe..90ffeaa6 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -135,19 +135,20 @@ set_cmd(int argc, char *argv[]) if (argc < 2) { usage(argv[0]); - } else if (argc > 2) { - for (i = 0; (i < items(op)) && (cmd == NULL); i++) { - if (strcmp(COMMAND, op[i].str) != 0) - continue; - if (argc >= op[i].args) { - cmd = op[i].cmd; - break; - } - err(set_err(EINVAL), "Too few args on command '%s'", - op[i].str); - } - } else { /* argc == 2 */ + } else if (argc == 2) { /* argc == 2 */ cmd = cmd_setmac; + return; + } + + for (i = 0; (i < items(op)) && (cmd == NULL); i++) { + if (strcmp(COMMAND, op[i].str) != 0) + continue; + if (argc >= op[i].args) { + cmd = op[i].cmd; + break; + } + err(set_err(EINVAL), "Too few args on command '%s'", + op[i].str); } } -- cgit v1.2.1