Commit 370b6c5c4d764192399a220095a2dd1054314147
1 parent
0eb2acee39
Exists in
master
and in
50 other branches
sandbox: Correct data sizes and printf() strings in fdtdec.c
There are a few wwrnings in this file when building for sandbox. Addresses coming from the device tree need to be treated as ulong as elsewhere in U-Boot and we must use map_sysmem() to convert to a pointer when needed. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Hung-ying Tyan <tyanh@chromium.org>
Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff
lib/fdtdec.c
... | ... | @@ -86,10 +86,10 @@ |
86 | 86 | size = (fdt_size_t *)((char *)cell + |
87 | 87 | sizeof(fdt_addr_t)); |
88 | 88 | *sizep = fdt_size_to_cpu(*size); |
89 | - debug("addr=%p, size=%p\n", (void *)addr, | |
90 | - (void *)*sizep); | |
89 | + debug("addr=%08lx, size=%08x\n", | |
90 | + (ulong)addr, *sizep); | |
91 | 91 | } else { |
92 | - debug("%p\n", (void *)addr); | |
92 | + debug("%08lx\n", (ulong)addr); | |
93 | 93 | } |
94 | 94 | return addr; |
95 | 95 | } |
... | ... | @@ -611,7 +611,7 @@ |
611 | 611 | if (!cell || (len != sizeof(fdt_addr_t) * 2)) |
612 | 612 | return -1; |
613 | 613 | |
614 | - *ptrp = (void *)fdt_addr_to_cpu(*cell); | |
614 | + *ptrp = map_sysmem(fdt_addr_to_cpu(*cell), *size); | |
615 | 615 | *size = fdt_size_to_cpu(cell[1]); |
616 | 616 | debug("%s: size=%zx\n", __func__, *size); |
617 | 617 | return 0; |