]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
dtc: libfdt: Introduce a can_assume check in fdt_check_full
authorTom Rini <trini@konsulko.com>
Tue, 26 May 2026 20:19:28 +0000 (14:19 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 17 Jun 2026 20:06:48 +0000 (14:06 -0600)
The current upstream method of having a function omit various tests is
to use the can_assume macro. Take the logic we had previously been using
and instead make it a can_assume(PERFECT) check within fdt_check_full
itself.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
scripts/dtc/libfdt/fdt_check.c

index a21ebbc9239f0991b3582d9d8a401c48a7c483fa..7509c11d85803194cb2d36521b76f85910001b53 100644 (file)
@@ -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))