diff options
author | Kever Yang <kever.yang@rock-chips.com> | 2020-03-30 11:56:17 +0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-04-24 10:10:00 -0400 |
commit | c738adb8dbbf28a34f8574239a241e85d46f3877 (patch) | |
tree | f16bc06c077bda0a20db03571e23c053d9a95363 /tools/ifwitool.c | |
parent | 9b544c9eb312741e8e27bb738329bcf2737168ad (diff) |
tool: Move ALIGN_MASK to header as common MACRO
The ALIGN code is need by many files who need handle structure or image
align, so move the macro to imagetool.h file.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/ifwitool.c')
-rw-r--r-- | tools/ifwitool.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/ifwitool.c b/tools/ifwitool.c index 543e9d4e70..b2b06cc921 100644 --- a/tools/ifwitool.c +++ b/tools/ifwitool.c @@ -8,15 +8,13 @@ #include <assert.h> #include <stdbool.h> #include <getopt.h> +#include "imagetool.h" #include "os_support.h" #ifndef __packed #define __packed __attribute__((packed)) #endif #define KiB 1024 -#define ALIGN(x, a) __ALIGN_MASK((x), (typeof(x))(a) - 1) -#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) /* * min()/max()/clamp() macros that also do |