From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 3/8] tools: mkimage: use common ALIGN to do the size align
Date: Thu, 26 Mar 2020 18:09:11 +0800 [thread overview]
Message-ID: <20200326100916.22532-3-kever.yang@rock-chips.com> (raw)
In-Reply-To: <20200326100916.22532-1-kever.yang@rock-chips.com>
The ALIGN() is now available at imagetool.h, migrate to use it.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---
Changes in v3: None
Changes in v2: None
tools/mkimage.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
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 at denx.de
*/
+#include "imagetool.h"
#include "mkimage.h"
#include "imximage.h"
#include <image.h>
@@ -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
--
2.17.1
next prev parent reply other threads:[~2020-03-26 10:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-26 10:09 [PATCH v3 1/8] tool: Move ALIGN_MASK to header as common MACRO Kever Yang
2020-03-26 10:09 ` [PATCH v3 2/8] tool: aisimage: use ALIGN instead of self defiend macro Kever Yang
2020-03-27 18:16 ` Tom Rini
2020-03-26 10:09 ` Kever Yang [this message]
2020-03-27 18:16 ` [PATCH v3 3/8] tools: mkimage: use common ALIGN to do the size align Tom Rini
2020-03-26 10:09 ` [PATCH v3 4/8] tools: kwbimage: " Kever Yang
2020-03-26 10:12 ` Stefan Roese
2020-03-27 18:16 ` Tom Rini
2020-03-26 10:09 ` [PATCH v3 5/8] tools: imx8mimage: remove redundant code Kever Yang
2020-03-27 18:16 ` Tom Rini
2020-03-26 10:09 ` [PATCH v3 6/8] tool: use ALIGN() to align the size Kever Yang
2020-03-26 11:39 ` Heinrich Schuchardt
2020-03-27 18:16 ` Tom Rini
2020-03-26 10:09 ` [PATCH v3 7/8] libfdt: Make fdtdec_get_child_count() available for HOST Kever Yang
2020-03-28 20:04 ` Simon Glass
2020-03-26 10:09 ` [PATCH v3 8/8] mkimage: fit_image: Add option to make fit header align Kever Yang
2020-03-27 18:16 ` Tom Rini
2020-03-30 2:35 ` Kever Yang
2020-03-27 3:27 ` [PATCH v3 1/8] tool: Move ALIGN_MASK to header as common MACRO Punit Agrawal
2020-03-27 18:16 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200326100916.22532-3-kever.yang@rock-chips.com \
--to=kever.yang@rock-chips.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox