util: Use common ARRAY_SIZE define

Remove duplicated definitions of ARRAY_SIZE macro across util/ dir.
Instead of duplicates, use the one from commonlib/bsd/helpers.h file.

BUG=b:231765496
TEST=make -C util/cbfstool; make -C util/cbmem;
     make -C util/intelmetool; make -C util/superiotool

Change-Id: I29b776586b4f0548d4026b2ac77095791fc9f3a3
Signed-off-by: Konrad Adamczyk <konrada@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74474
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-by: Grzegorz Bernacki
Reviewed-by: Robert Zieba <robertzieba@google.com>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Konrad Adamczyk
2023-04-11 10:26:12 +00:00
committed by Felix Held
parent 9203f5ee85
commit d6b4db159b
8 changed files with 12 additions and 13 deletions

View File

@@ -1,8 +1,9 @@
## SPDX-License-Identifier: GPL-2.0-only
TOP = $(abspath ../../..)
DOIMAGE_FOLDER = marvell/doimage_mv
DOIMAGE_BINARY = doimage
CFLAGS = -g -O1 -I./../inc -DMV_CPU_LE
CFLAGS = -g -O1 -I./../inc -DMV_CPU_LE -I $(TOP)/src/commonlib/bsd/include
$(objutil)/$(DOIMAGE_FOLDER):
mkdir -p $@

View File

@@ -19,6 +19,7 @@ disclaimer.
#define _INC_DOIMAGE_H
#include <sys/types.h>
#include <commonlib/bsd/helpers.h>
/* use the same version as in "bootrom.inc" file */
#define VERSION_NUMBER "2.20"
@@ -57,8 +58,6 @@ disclaimer.
#define O_BINARY 0
#endif
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
typedef enum {
IMG_SATA,
IMG_UART,