U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rv@rasmusvillemoes.dk>
To: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de,
	 Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Anton Ivanov <anton@binarly.io>
Subject: Re: [PATCH 2/2] dtc: libfdt: Introduce a can_assume check in fdt_check_full
Date: Wed, 27 May 2026 11:49:28 +0200	[thread overview]
Message-ID: <87a4tlji6v.fsf@prevas.dk> (raw)
In-Reply-To: <20260526202218.4004070-3-trini@konsulko.com> (Tom Rini's message of "Tue, 26 May 2026 14:19:28 -0600")

On Tue, May 26 2026, Tom Rini <trini@konsulko.com> wrote:

> 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.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> I will be submitting this change upstream and will follow up if needed
> here.
> ---
>  scripts/dtc/libfdt/fdt_check.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/scripts/dtc/libfdt/fdt_check.c b/scripts/dtc/libfdt/fdt_check.c
> index a21ebbc9239f..7509c11d8580 100644
> --- a/scripts/dtc/libfdt/fdt_check.c
> +++ b/scripts/dtc/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;

Is this right? I think that would require changing can_assume() to test
if the given mask is a subset of FDT_ASSUME_MASK, not merely intersects
it. When called with a single-bit mask, those are of course the same
thing.

Because as-is, can_assume(PERFECT) is true if FDT_ASSUME_MASK has any
non-zero value, but I don't think FDT_ASSUME_MASK=ASSUME_LATEST, for
example, should imply "perfect".

Rasmus

  parent reply	other threads:[~2026-05-27 12:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 20:19 [PATCH 0/2] dtc: Resync fdt_check_full function Tom Rini
2026-05-26 20:19 ` [PATCH 1/2] dtc: Resync fdt_check_full() with upstream version v1.7.2-35-g52f07dcca47c Tom Rini
2026-05-27  4:41   ` Simon Glass
2026-05-26 20:19 ` [PATCH 2/2] dtc: libfdt: Introduce a can_assume check in fdt_check_full Tom Rini
2026-05-27  4:41   ` Simon Glass
2026-05-27 14:41     ` Tom Rini
2026-05-27  9:49   ` Rasmus Villemoes [this message]
2026-05-27 14:45     ` Tom Rini
2026-06-18  1:08 ` [PATCH 0/2] dtc: Resync fdt_check_full function Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a4tlji6v.fsf@prevas.dk \
    --to=rv@rasmusvillemoes.dk \
    --cc=anton@binarly.io \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox