mtd: mxs_nand: fix the gf_13/14 definition issue
[oweals/u-boot.git] / cmd / trace.c
index a0a7dd1995983445da4bd82ad0b2cbf5d63a355b..392b129536176dbbbfb097f7751199d50442591c 100644 (file)
@@ -1,11 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <mapmem.h>
 #include <trace.h>
 #include <asm/io.h>
@@ -31,8 +31,7 @@ static int get_args(int argc, char * const argv[], char **buff,
 
 static int create_func_list(int argc, char * const argv[])
 {
-       size_t buff_size, avail, buff_ptr, used;
-       unsigned int needed;
+       size_t buff_size, avail, buff_ptr, needed, used;
        char *buff;
        int err;
 
@@ -42,7 +41,7 @@ static int create_func_list(int argc, char * const argv[])
        avail = buff_size - buff_ptr;
        err = trace_list_functions(buff + buff_ptr, avail, &needed);
        if (err)
-               printf("Error: truncated (%#x bytes needed)\n", needed);
+               printf("Error: truncated (%#zx bytes needed)\n", needed);
        used = min(avail, (size_t)needed);
        printf("Function trace dumped to %08lx, size %#zx\n",
               (ulong)map_to_sysmem(buff + buff_ptr), used);
@@ -55,8 +54,7 @@ static int create_func_list(int argc, char * const argv[])
 
 static int create_call_list(int argc, char * const argv[])
 {
-       size_t buff_size, avail, buff_ptr, used;
-       unsigned int needed;
+       size_t buff_size, avail, buff_ptr, needed, used;
        char *buff;
        int err;
 
@@ -66,7 +64,7 @@ static int create_call_list(int argc, char * const argv[])
        avail = buff_size - buff_ptr;
        err = trace_list_calls(buff + buff_ptr, avail, &needed);
        if (err)
-               printf("Error: truncated (%#x bytes needed)\n", needed);
+               printf("Error: truncated (%#zx bytes needed)\n", needed);
        used = min(avail, (size_t)needed);
        printf("Call list dumped to %08lx, size %#zx\n",
               (ulong)map_to_sysmem(buff + buff_ptr), used);