summaryrefslogtreecommitdiffstats
path: root/cpukit/dtc/libfdt/fdt_ro.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-02-20 14:45:52 -0700
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-03-02 07:52:21 +0100
commite9ebc6ab87cda8b25c2ed776120e51338fcc8163 (patch)
tree01d622852c25d9c1518106ece795140ddf8703ff /cpukit/dtc/libfdt/fdt_ro.c
parentAdd a way to control the level of checks in the code (diff)
downloadrtems-e9ebc6ab87cda8b25c2ed776120e51338fcc8163.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 '')
-rw-r--r--cpukit/dtc/libfdt/fdt_ro.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/dtc/libfdt/fdt_ro.c b/cpukit/dtc/libfdt/fdt_ro.c
index a5c2797cde..4c26fbeb8d 100644
--- a/cpukit/dtc/libfdt/fdt_ro.c
+++ b/cpukit/dtc/libfdt/fdt_ro.c
@@ -388,7 +388,8 @@ static const struct fdt_property *fdt_get_property_namelen_(const void *fdt,
(offset = fdt_next_property_offset(fdt, offset))) {
const struct fdt_property *prop;
- if (!(prop = fdt_get_property_by_offset_(fdt, offset, lenp))) {
+ prop = fdt_get_property_by_offset_(fdt, offset, lenp);
+ if (!can_assume(VALID_DTB) && !prop) {
offset = -FDT_ERR_INTERNAL;
break;
}