From f270f45fd5d2baac37d559f0063110cb646b2332 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 20 Feb 2020 14:45:56 -0700 Subject: [PATCH] libfdt: Add support for disabling ordering check/fixup 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 Reviewed-by: David Gibson Message-Id: <20200220214557.176528-8-sjg@chromium.org> Signed-off-by: David Gibson --- 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..1385425 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(LIBFDT_ORDER) | + !fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) { /* no further work necessary */ err = fdt_move(fdt, buf, bufsize); if (err)