mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-20 15:03:44 +02:00
util/nvmutil: clearer intent on struct data
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -100,12 +100,12 @@ static const char rmac[] = "xx:xx:xx:xx:xx:xx";
|
|||||||
static const char *fname = "";
|
static const char *fname = "";
|
||||||
static const char *argv0;
|
static const char *argv0;
|
||||||
|
|
||||||
struct op {
|
struct commands {
|
||||||
const char *str;
|
const char *str;
|
||||||
void (*cmd)(void);
|
void (*cmd)(void);
|
||||||
int args;
|
int args;
|
||||||
};
|
};
|
||||||
static const struct op ops[] = {
|
static const struct commands command[] = {
|
||||||
{ "dump", cmd_dump, 3 },
|
{ "dump", cmd_dump, 3 },
|
||||||
{ "setmac", cmd_setmac, 3 },
|
{ "setmac", cmd_setmac, 3 },
|
||||||
{ "swap", cmd_swap, 3 },
|
{ "swap", cmd_swap, 3 },
|
||||||
@@ -234,14 +234,14 @@ set_cmd(int argc, char *argv[])
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < items(ops) && cmd == NULL; i++) {
|
for (i = 0; i < items(command) && cmd == NULL; i++) {
|
||||||
if (strcmp(argv[2], ops[i].str) != 0)
|
if (strcmp(argv[2], command[i].str) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (argc >= ops[i].args) {
|
if (argc >= command[i].args) {
|
||||||
cmd = ops[i].cmd;
|
cmd = command[i].cmd;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
err(EINVAL, "Too few args: command '%s'", ops[i].str);
|
err(EINVAL, "Too few args: command '%s'", command[i].str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user