[U-Boot] [PATCH 04/16] trace: Fix compiler warnings in trace
Simon Glass
sjg at chromium.org
Mon Feb 15 02:36:48 CET 2016
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 at chromium.org>
---
cmd/trace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmd/trace.c b/cmd/trace.c
index 1e62a1a..1a6d8c3 100644
--- a/cmd/trace.c
+++ b/cmd/trace.c
@@ -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);
--
2.7.0.rc3.207.g0ac5344
More information about the U-Boot
mailing list