aboutsummaryrefslogtreecommitdiff
path: root/libfdt/fdt_rw.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-02-20 14:45:52 -0700
committerDavid Gibson <david@gibson.dropbear.id.au>2020-02-24 13:38:44 +1100
commit57bc6327b80bc95bee9fc5f07d4fc83186a8f167 (patch)
tree9da35900a63bed5ce4333a1424d6b4e96c445427 /libfdt/fdt_rw.c
parent464962489dcc563e354ff64c9e58856185f32728 (diff)
downloaddtc-57bc6327b80bc95bee9fc5f07d4fc83186a8f167.zip
dtc-57bc6327b80bc95bee9fc5f07d4fc83186a8f167.tar.gz
dtc-57bc6327b80bc95bee9fc5f07d4fc83186a8f167.tar.bz2
libfdt: Add support for disabling dtb checks
Support ASSUME_VALID_DTB to disable some sanity checks If we assume that the DTB itself is valid then we can skip some checks and save code space. Add various conditions to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Message-Id: <20200220214557.176528-4-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'libfdt/fdt_rw.c')
-rw-r--r--libfdt/fdt_rw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c
index 8795947..707c00a 100644
--- a/libfdt/fdt_rw.c
+++ b/libfdt/fdt_rw.c
@@ -24,6 +24,8 @@ static int fdt_blocks_misordered_(const void *fdt,
static int fdt_rw_probe_(void *fdt)
{
+ if (can_assume(VALID_DTB))
+ return 0;
FDT_RO_PROBE(fdt);
if (fdt_version(fdt) < 17)