Merge tag 'efi-2020-07-rc6' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[oweals/u-boot.git] / cmd / trace.c
index 26bf0960d49e3fff3b9005794769910841ac3f29..4ce47c7627607a9721baed61e9c45fb9b160c13f 100644 (file)
@@ -5,11 +5,12 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <mapmem.h>
 #include <trace.h>
 #include <asm/io.h>
 
-static int get_args(int argc, char * const argv[], char **buff,
+static int get_args(int argc, char *const argv[], char **buff,
                    size_t *buff_ptr, size_t *buff_size)
 {
        if (argc < 2)
@@ -28,10 +29,9 @@ static int get_args(int argc, char * const argv[], char **buff,
        return 0;
 }
 
-static int create_func_list(int argc, char * const argv[])
+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;
 
@@ -41,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);
@@ -52,10 +52,9 @@ static int create_func_list(int argc, char * const argv[])
        return 0;
 }
 
-static int create_call_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;
 
@@ -65,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);
@@ -77,7 +76,7 @@ static int create_call_list(int argc, char * const argv[])
        return 0;
 }
 
-int do_trace(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_trace(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
        const char *cmd = argc < 2 ? NULL : argv[1];