From 628af1790ac3231455c1ae4a4e43b67136799fa2 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 30 Aug 2013 11:00:09 -0600 Subject: sandbox: Correct compiler warnings in cmd_bootm/cmd_ximg Correct the following warnings found with sandbox when compression is enabled. cmd_bootm.c: In function 'bootm_load_os': cmd_bootm.c:443:11: warning: passing argument 4 of 'lzop_decompress' from incompatible pointer type [enabled by default] /usr/local/google/c/cosarm/src/third_party/u-boot/files/include/linux/lzo.h:31:5: note: expected 'size_t *' but argument is of type 'uint *' cmd_ximg.c: In function 'do_imgextract': cmd_ximg.c:225:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] cmd_ximg.c:225:14: warning: 'hdr' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Simon Glass Acked-by: Kees Cook --- common/cmd_ximg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/cmd_ximg.c') diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c index b439be3..65a8319 100644 --- a/common/cmd_ximg.c +++ b/common/cmd_ximg.c @@ -20,6 +20,7 @@ #include #endif #include +#include #ifndef CONFIG_SYS_XIMG_LEN /* use 8MByte as default max gunzip size */ @@ -34,7 +35,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) ulong data, len, count; int verify; int part = 0; - image_header_t *hdr; + image_header_t *hdr = NULL; #if defined(CONFIG_FIT) const char *uname = NULL; const void* fit_hdr; @@ -222,7 +223,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) * which requires at most 2300 KB of memory. */ i = BZ2_bzBuffToBuffDecompress( - (char *)ntohl(hdr->ih_load), + map_sysmem(ntohl(hdr->ih_load), 0), &unc_len, (char *)data, len, CONFIG_SYS_MALLOC_LEN < (4096 * 1024), 0); -- cgit v1.1