Patchwork [U-Boot,V3,04/32] imximage: fix size of image to load.

login
register
mail settings
Submitter Troy Kisky
Date Oct. 4, 2012, 1:47 a.m.
Message ID <1349315254-21151-5-git-send-email-troy.kisky@boundarydevices.com>
Download mbox | patch
Permalink /patch/188985/
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Comments

Troy Kisky - Oct. 4, 2012, 1:47 a.m.
sbuf->st_size already includes sizeof(struct imx_header),
so remove extra addition.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v3: split into its own patch
---
 tools/imximage.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Stefano Babic - Oct. 20, 2012, 3:47 p.m.
Am 04/10/2012 03:47, schrieb Troy Kisky:
> sbuf->st_size already includes sizeof(struct imx_header),
> so remove extra addition.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> 
> ---


Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Patch

diff --git a/tools/imximage.c b/tools/imximage.c
index 3e9ee6a..7dbf36c 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -221,8 +221,7 @@  static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
 
 	/* The external flash header must be at the end of the DCD table */
 	dcd_v1->addr_data[dcd_len].type = sbuf->st_size +
-				imxhdr->flash_offset +
-				sizeof(struct imx_header);
+				imxhdr->flash_offset;
 
 	/* Security feature are not supported */
 	fhdr_v1->app_code_csf = 0;
@@ -253,8 +252,7 @@  static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
 
 	hdr_v2->boot_data.start = fhdr_v2->self - imxhdr->flash_offset;
 	hdr_v2->boot_data.size = sbuf->st_size +
-			imxhdr->flash_offset +
-			sizeof(struct imx_header);
+			imxhdr->flash_offset;
 
 	/* Security feature are not supported */
 	fhdr_v2->csf = 0;