From: Kever Yang Date: Mon, 30 Mar 2020 03:56:19 +0000 (+0800) Subject: tools: mkimage: use common ALIGN to do the size align X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=29e7ab01866f44eec9dbe9ec7093eb1d1dda57d5;p=u-boot.git tools: mkimage: use common ALIGN to do the size align The ALIGN() is now available at imagetool.h, migrate to use it. Signed-off-by: Kever Yang Reviewed-by: Punit Agrawal Reviewed-by: Tom Rini --- diff --git a/tools/mkimage.c b/tools/mkimage.c index 5f51d2cc89..0279f6867e 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -7,6 +7,7 @@ * Wolfgang Denk, wd@denx.de */ +#include "imagetool.h" #include "mkimage.h" #include "imximage.h" #include @@ -557,8 +558,8 @@ int main(int argc, char **argv) } if (params.type == IH_TYPE_FIRMWARE_IVT) { /* Add alignment and IVT */ - uint32_t aligned_filesize = (params.file_size + 0x1000 - - 1) & ~(0x1000 - 1); + uint32_t aligned_filesize = ALIGN(params.file_size, + 0x1000); flash_header_v2_t ivt_header = { { 0xd1, 0x2000, 0x40 }, params.addr, 0, 0, 0, params.addr + aligned_filesize