mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-30 16:35:37 +00:00
tool: use ALIGN() to align the size
Use the ALIGN() for size align so that the code is more readable. 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> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
e5ad99cc99
commit
02560b1368
2 changed files with 2 additions and 2 deletions
|
@ -547,7 +547,7 @@ static int fit_import_data(struct image_tool_params *params, const char *fname)
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
fit_size = fdt_totalsize(old_fdt);
|
fit_size = fdt_totalsize(old_fdt);
|
||||||
data_base = (fit_size + 3) & ~3;
|
data_base = ALIGN(fit_size, 4);
|
||||||
|
|
||||||
/* Allocate space to hold the new FIT */
|
/* Allocate space to hold the new FIT */
|
||||||
size = sbuf.st_size + 16384;
|
size = sbuf.st_size + 16384;
|
||||||
|
|
|
@ -203,7 +203,7 @@ static int sfp_sign_buffer(uint8_t *buf, uint8_t ver, uint8_t flags,
|
||||||
uint32_t calc_crc;
|
uint32_t calc_crc;
|
||||||
|
|
||||||
/* Align the length up */
|
/* Align the length up */
|
||||||
len = (len + 3) & ~3;
|
len = ALIGN(len, 4);
|
||||||
|
|
||||||
/* Build header, adding 4 bytes to length to hold the CRC32. */
|
/* Build header, adding 4 bytes to length to hold the CRC32. */
|
||||||
sfp_build_header(buf + HEADER_OFFSET, ver, flags, len + 4);
|
sfp_build_header(buf + HEADER_OFFSET, ver, flags, len + 4);
|
||||||
|
|
Loading…
Add table
Reference in a new issue