From d6b4db159b60089c3d6e9aad993804ea319047e2 Mon Sep 17 00:00:00 2001 From: Konrad Adamczyk Date: Tue, 11 Apr 2023 10:26:12 +0000 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74474 Reviewed-by: Jakub Czapiga Reviewed-by: Grzegorz Bernacki Reviewed-by: Robert Zieba Reviewed-by: Elyes Haouas Tested-by: build bot (Jenkins) --- util/superiotool/Makefile | 4 +++- util/superiotool/superiotool.h | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'util/superiotool') diff --git a/util/superiotool/Makefile b/util/superiotool/Makefile index f8c1cc1f86df..e6a21609899a 100644 --- a/util/superiotool/Makefile +++ b/util/superiotool/Makefile @@ -2,6 +2,7 @@ PROGRAM = superiotool +TOP ?= $(abspath ../..) CC ?= gcc INSTALL ?= /usr/bin/env install PREFIX ?= /usr/local @@ -11,7 +12,8 @@ PREFIX ?= /usr/local VERSION := -D'SUPERIOTOOL_VERSION="$(shell git describe 2>/dev/null)"' CFLAGS += -O2 -Wall -Wstrict-prototypes -Wundef -Wstrict-aliasing \ - -Werror-implicit-function-declaration -ansi -pedantic $(VERSION) + -Werror-implicit-function-declaration -ansi -pedantic $(VERSION) \ + -Wno-variadic-macros -I $(TOP)/src/commonlib/bsd/include LDFLAGS += -lz OBJS = superiotool.o serverengines.o ali.o exar.o fintek.o ite.o nsc.o \ diff --git a/util/superiotool/superiotool.h b/util/superiotool/superiotool.h index 8c0155975986..14090309ee06 100644 --- a/util/superiotool/superiotool.h +++ b/util/superiotool/superiotool.h @@ -8,6 +8,7 @@ #include #include #include +#include #if defined(__linux__) #include #endif @@ -109,8 +110,6 @@ and print its vendor, name, ID, revision, and config port.\n" #define NOTFOUND " Failed. Returned data: " -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) - #define EOT -1 /* End Of Table */ #define NOLDN -2 /* NO LDN needed */ #define NANA -3 /* Not Available: -- cgit v1.2.3