]> Git Repo - u-boot.git/blobdiff - cmd/zip.c
doc: Bring in FIT x86 boot
[u-boot.git] / cmd / zip.c
index dac7527721861dfbf45c736304141d7236b3b632..08afd62b973d88b505035e8fd8bcd02e9b1e593e 100644 (file)
--- a/cmd/zip.c
+++ b/cmd/zip.c
@@ -1,26 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2012
  * Lei Wen <[email protected]>, Marvell Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
+#include <gzip.h>
 
-static int do_zip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_zip(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
        unsigned long src, dst;
        unsigned long src_len, dst_len = ~0UL;
 
        switch (argc) {
                case 5:
-                       dst_len = simple_strtoul(argv[4], NULL, 16);
+                       dst_len = hextoul(argv[4], NULL);
                        /* fall through */
                case 4:
-                       src = simple_strtoul(argv[1], NULL, 16);
-                       src_len = simple_strtoul(argv[2], NULL, 16);
-                       dst = simple_strtoul(argv[3], NULL, 16);
+                       src = hextoul(argv[1], NULL);
+                       src_len = hextoul(argv[2], NULL);
+                       dst = hextoul(argv[3], NULL);
                        break;
                default:
                        return cmd_usage(cmdtp);
@@ -29,7 +30,7 @@ static int do_zip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (gzip((void *) dst, &dst_len, (void *) src, src_len) != 0)
                return 1;
 
-       printf("Compressed size: %ld = 0x%lX\n", dst_len, dst_len);
+       printf("Compressed size: %lu = 0x%lX\n", dst_len, dst_len);
        env_set_hex("filesize", dst_len);
 
        return 0;
This page took 0.031915 seconds and 4 git commands to generate.