summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-02-20 14:45:56 -0700
committerDavid Gibson <david@gibson.dropbear.id.au>2020-02-24 13:38:44 +1100
commitf270f45fd5d2baac37d559f0063110cb646b2332 (patch)
treed7543be4ea99de2055a5411e35a876f211e3692d
parentc18bae9a4c96a9258fdcee30fe4b0c4fc3730036 (diff)
downloaddevice-tree-compiler-f270f45fd5d2baac37d559f0063110cb646b2332.tar.gz
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 <sjg@chromium.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20200220214557.176528-8-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--libfdt/fdt_rw.c3
1 files changed, 2 insertions, 1 deletions
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)