]> git.sur5r.net Git - u-boot/commitdiff
trace: Fix compiler warnings in trace
authorSimon Glass <sjg@chromium.org>
Wed, 24 Feb 2016 16:14:45 +0000 (09:14 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 26 Feb 2016 15:53:10 +0000 (08:53 -0700)
With min() we must use the same type for each parameter. Fix two problems
in trace.c which produce compiler warnings.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
cmd/trace.c

index 1e62a1a1999e37bae3c3bdfc413185568eff4a25..1a6d8c304746214689a6edbb5891593e6a6c82a3 100644 (file)
@@ -43,7 +43,7 @@ static int create_func_list(int argc, char * const argv[])
        err = trace_list_functions(buff + buff_ptr, avail, &needed);
        if (err)
                printf("Error: truncated (%#x bytes needed)\n", needed);
-       used = min(avail, needed);
+       used = min(avail, (size_t)needed);
        printf("Function trace dumped to %08lx, size %#zx\n",
               (ulong)map_to_sysmem(buff + buff_ptr), used);
        setenv_hex("profbase", map_to_sysmem(buff));
@@ -67,7 +67,7 @@ static int create_call_list(int argc, char * const argv[])
        err = trace_list_calls(buff + buff_ptr, avail, &needed);
        if (err)
                printf("Error: truncated (%#x bytes needed)\n", needed);
-       used = min(avail, needed);
+       used = min(avail, (size_t)needed);
        printf("Call list dumped to %08lx, size %#zx\n",
               (ulong)map_to_sysmem(buff + buff_ptr), used);