From 6f2e5149f292d7f67ffa551a0934104f7481440d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 8 Mar 2026 14:36:58 +0000 Subject: util/nvmutil: use N_COMMAND for items(command) make the code slightly easier to read Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util/nvmutil') 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) -- cgit v1.2.1