aboutsummaryrefslogtreecommitdiff
path: root/board/toradex/common/tdx-cfg-block.c
diff options
context:
space:
mode:
authorFrancesco Dolcini2022-07-21 15:17:33 +0200
committerStefano Babic2022-07-25 16:12:00 +0200
commitcdc39c6aaea33a9a47657f7798090ca973053a2f (patch)
tree4b89a825ea4fa1fbafd8eaf699bb49a747613b69 /board/toradex/common/tdx-cfg-block.c
parentea1dc32f318903340a5ddaa8dc655503d1b4599e (diff)
toradex: common: Use ARRAY_SIZE macro
Use generally available ARRAY_SIZE macro, instead of hand-coding it every time is needed. Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Diffstat (limited to 'board/toradex/common/tdx-cfg-block.c')
-rw-r--r--board/toradex/common/tdx-cfg-block.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index 67d007827be..26596199a38 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -381,8 +381,7 @@ int read_tdx_cfg_block(void)
}
/* Cap product id to avoid issues with a yet unknown one */
- if (tdx_hw_tag.prodid >= (sizeof(toradex_modules) /
- sizeof(toradex_modules[0])))
+ if (tdx_hw_tag.prodid >= ARRAY_SIZE(toradex_modules))
tdx_hw_tag.prodid = 0;
out:
@@ -822,8 +821,7 @@ static int get_cfgblock_carrier_interactive(void)
printf("Supported carrier boards:\n");
printf("CARRIER BOARD NAME\t\t [ID]\n");
- for (int i = 0; i < sizeof(toradex_carrier_boards) /
- sizeof(toradex_carrier_boards[0]); i++)
+ for (int i = 0; i < ARRAY_SIZE(toradex_carrier_boards); i++)
if (toradex_carrier_boards[i])
printf("%s \t\t [%d]\n", toradex_carrier_boards[i], i);