From: Francesco Dolcini Date: Thu, 21 Jul 2022 13:17:33 +0000 (+0200) Subject: toradex: common: Use ARRAY_SIZE macro X-Git-Tag: baikal/mips/sdk5.8.2~5^2~273^2~88 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=822ea7b6f8430a80c60598b06b41327a63913e60;p=uboot.git 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 --- diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 67d007827b..26596199a3 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);