Patchwork [U-Boot,v2,03/45] mkimage: Move ARRAY_SIZE to header file

login
register
mail settings
Submitter Simon Glass
Date March 18, 2013, 11:51 p.m.
Message ID <1363650725-30459-4-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/228849/
State Deferred
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - March 18, 2013, 11:51 p.m.
Move this definition from aisimage.c to mkimage.h so that it is available
more widely.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
---
Changes in v2: None

 tools/aisimage.c | 1 -
 tools/mkimage.h  | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/tools/aisimage.c b/tools/aisimage.c
index c645708..659df8c 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 ea45f5c..e07a615 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"