From 66e1201c3775716607c28afd2bbb2b3afb08b695 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 26 May 2026 14:30:22 -0600 Subject: [PATCH] libfdt: fdt_check_full: Add can_assume(PERFECT) check In this function from fdt_check.c we have (reasonably and as the name implies) a number of checks on the DTB. However, there are cases where we may wish to assume that we have been given a perfect DTB already and do nothing here. Add a test for can_assume(PERFECT) as the first check in this function and if true, perform no checks. Signed-off-by: Tom Rini Message-ID: <20260526203022.4006434-1-trini@konsulko.com> Reviewed-by: Simon Glass Signed-off-by: David Gibson --- libfdt/fdt_check.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libfdt/fdt_check.c b/libfdt/fdt_check.c index cca0523..2fd5b61 100644 --- a/libfdt/fdt_check.c +++ b/libfdt/fdt_check.c @@ -21,6 +21,8 @@ int fdt_check_full(const void *fdt, size_t bufsize) const char *propname; bool expect_end = false; + if (can_assume(PERFECT)) + return 0; if (bufsize < FDT_V1_SIZE) return -FDT_ERR_TRUNCATED; if (bufsize < fdt_header_size(fdt))