diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-03 15:56:06 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-03 15:56:06 +0000 |
| commit | f1ee2ff63058b96c89669581fe8058923ae7dd67 (patch) | |
| tree | dba608ad489a5e907d3c26e3294146e4138b5135 /util | |
| parent | 6d8cf8909fbaf091bc2b214139a41c9f3ddbb978 (diff) | |
util/nvmutil: tidy up set_cmd
reduced indentation
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 25 |
1 files changed, 13 insertions, 12 deletions
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); } } |
