summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-08 14:36:58 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-08 14:37:25 +0000
commit6f2e5149f292d7f67ffa551a0934104f7481440d (patch)
tree9978f072139c4cc11da31c4477cdc6f2eb2c059c
parent10507e143661cc5d8bfa0678c0ffb30a82406b35 (diff)
util/nvmutil: use N_COMMAND for items(command)
make the code slightly easier to read Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 672f782f..35504729 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -207,7 +207,8 @@ static const struct commands command[] = {
};
#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
@@ -472,7 +473,7 @@ check_command_num(size_t c)
static uint8_t
valid_command(size_t c)
{
- if (c >= items(command))
+ if (c >= N_COMMANDS)
return 0;
if (c != command[c].chk)