util/nvmutil: use N_COMMAND for items(command)

make the code slightly easier to read

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-08 14:36:58 +00:00
parent 10507e1436
commit 6f2e5149f2
+3 -2
View File
@@ -207,7 +207,8 @@ static const struct commands command[] = {
}; };
#define MAX_CMD_LEN 50 #define MAX_CMD_LEN 50
#define CMD_NULL items(command) #define N_COMMANDS items(command)
#define CMD_NULL N_COMMANDS
/* /*
* Index in command[], will be set later * Index in command[], will be set later
@@ -472,7 +473,7 @@ check_command_num(size_t c)
static uint8_t static uint8_t
valid_command(size_t c) valid_command(size_t c)
{ {
if (c >= items(command)) if (c >= N_COMMANDS)
return 0; return 0;
if (c != command[c].chk) if (c != command[c].chk)