Add a way to remove this check and the reordering code, which is unnecessary if the dtb is known to be correctly ordered. Signed-off-by: Simon Glass <sjg@xxxxxxxxxxxx> --- Changes in v6: - Add a new patch to disable the ordering check and fixup Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None libfdt/fdt_rw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c index fe13671..0d9d1b2 100644 --- a/libfdt/fdt_rw.c +++ b/libfdt/fdt_rw.c @@ -435,7 +435,8 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize) return struct_size; } - if (!fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) { + if (can_assume(CORRECT_ORDER) | + !fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) { /* no further work necessary */ err = fdt_move(fdt, buf, bufsize); if (err) -- 2.25.0.341.g760bfbb309-goog