From: Simon Glass Date: Tue, 7 May 2013 06:11:49 +0000 (+0000) Subject: mkimage: Move ARRAY_SIZE to header file X-Git-Tag: v2013.07-rc1~1^2~48 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=816cb037adf94ead77593812ccd3244d506175fa;p=oweals%2Fu-boot.git mkimage: Move ARRAY_SIZE to header file Move this definition from aisimage.c to mkimage.h so that it is available more widely. Signed-off-by: Simon Glass Acked-by: Marek Vasut --- diff --git a/tools/aisimage.c b/tools/aisimage.c index c645708da5..659df8c0ee 100644 --- a/tools/aisimage.c +++ b/tools/aisimage.c @@ -32,7 +32,6 @@ #define WORD_ALIGN0 4 #define WORD_ALIGN(len) (((len)+WORD_ALIGN0-1) & ~(WORD_ALIGN0-1)) #define MAX_CMD_BUFFER 4096 -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) static uint32_t ais_img_size; diff --git a/tools/mkimage.h b/tools/mkimage.h index ea45f5c834..e07a6157eb 100644 --- a/tools/mkimage.h +++ b/tools/mkimage.h @@ -42,6 +42,8 @@ #define debug(fmt,args...) #endif /* MKIMAGE_DEBUG */ +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + #define MKIMAGE_TMPFILE_SUFFIX ".tmp" #define MKIMAGE_MAX_TMPFILE_LEN 256 #define MKIMAGE_DEFAULT_DTC_OPTIONS "-I dts -O dtb -p 500"