Merge tag 'u-boot-amlogic-20200428' of https://gitlab.denx.de/u-boot/custodians/u...
[oweals/u-boot.git] / tools / socfpgaimage.c
index 72d8b96f54140c535276040890d5dfc2d05997cd..6dfd64e31dd5487eea58d8077f42ee38baa363e8 100644 (file)
@@ -55,6 +55,7 @@
 #include "pbl_crc32.h"
 #include "imagetool.h"
 #include "mkimage.h"
+#include <u-boot/crc.h>
 
 #include <image.h>
 
@@ -202,7 +203,7 @@ static int sfp_sign_buffer(uint8_t *buf, uint8_t ver, uint8_t flags,
        uint32_t calc_crc;
 
        /* Align the length up */
-       len = (len + 3) & ~3;
+       len = ALIGN(len, 4);
 
        /* Build header, adding 4 bytes to length to hold the CRC32. */
        sfp_build_header(buf + HEADER_OFFSET, ver, flags, len + 4);