Message ID | 20230219101559.708444-1-wxjstz@126.com |
---|---|
State | Superseded |
Headers | show |
Series | lib: utils: fdt_fixup: Fix compile error | expand |
On Feb 19 2023, Xiang W wrote:
> Thus move the label "next_entry" to the beginning of the for loop.
This is not what the patch does.
在 2023-02-19星期日的 11:20 +0100,Andreas Schwab写道: > On Feb 19 2023, Xiang W wrote: > > > Thus move the label "next_entry" to the beginning of the for loop. > > This is not what the patch does. new patch at https://lists.infradead.org/pipermail/opensbi/2023-February/004494.html Regards, Xiang >
diff --git a/lib/utils/fdt/fdt_fixup.c b/lib/utils/fdt/fdt_fixup.c index 619e4f5..e23517d 100644 --- a/lib/utils/fdt/fdt_fixup.c +++ b/lib/utils/fdt/fdt_fixup.c @@ -361,19 +361,22 @@ int fdt_reserved_memory_fixup(void *fdt) return SBI_ENOSPC; } + int overlap = 0; addr = reg->base; for (j = 0; j < i; j++) { if (addr == filtered_base[j] && filtered_order[j] < reg->order) { + overlap = 1; filtered_order[j] = reg->order; - goto next_entry; + break; } } - filtered_base[i] = reg->base; - filtered_order[i] = reg->order; - i++; - next_entry: + if (!overlap) { + filtered_base[i] = reg->base; + filtered_order[i] = reg->order; + i++; + } } for (j = 0; j < i; j++) {