X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common%2Fcmd_ximg.c;h=850188eeae4e12c5dff9265c3435890f18fa0b79;hb=e42624bbe063c1f5da57b0a71ee67468bc2b4c68;hp=3e5fb44475b60fb98a228a8b40c8a15b3bdb85da;hpb=797312a15edc9dfb433e6903a75189030e7aaaaa;p=platform%2Fkernel%2Fu-boot.git diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c index 3e5fb44..850188e 100644 --- a/common/cmd_ximg.c +++ b/common/cmd_ximg.c @@ -43,7 +43,7 @@ #endif int -do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong addr = load_addr; ulong dest = 0; @@ -215,6 +215,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) memmove ((char *) dest, (char *)data, len); #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */ break; +#ifdef CONFIG_GZIP case IH_COMP_GZIP: printf (" Uncompressing part %d ... ", part); if (gunzip ((void *) dest, unc_len, @@ -223,22 +224,28 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return 1; } break; +#endif #if defined(CONFIG_BZIP2) case IH_COMP_BZIP2: - printf (" Uncompressing part %d ... ", part); - /* - * If we've got less than 4 MB of malloc() space, - * use slower decompression algorithm which requires - * at most 2300 KB of memory. - */ - i = BZ2_bzBuffToBuffDecompress - ((char*)ntohl(hdr->ih_load), - &unc_len, (char *)data, len, - CONFIG_SYS_MALLOC_LEN < (4096 * 1024), 0); - if (i != BZ_OK) { - printf ("BUNZIP2 ERROR %d - " - "image not loaded\n", i); - return 1; + { + int i; + + printf (" Uncompressing part %d ... ", part); + /* + * If we've got less than 4 MB of malloc() + * space, use slower decompression algorithm + * which requires at most 2300 KB of memory. + */ + i = BZ2_bzBuffToBuffDecompress( + (char*)ntohl(hdr->ih_load), + &unc_len, (char *)data, len, + CONFIG_SYS_MALLOC_LEN < (4096 * 1024), + 0); + if (i != BZ_OK) { + printf ("BUNZIP2 ERROR %d - " + "image not loaded\n", i); + return 1; + } } break; #endif /* CONFIG_BZIP2 */ @@ -257,7 +264,8 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return 0; } -U_BOOT_CMD(imxtract, 4, 1, do_imgextract, +U_BOOT_CMD( + imxtract, 4, 1, do_imgextract, "extract a part of a multi-image", "addr part [dest]\n" " - extract from legacy image at and copy to "