From: Tom Rini <trini@konsulko.com>
To: Rasmus Villemoes <rv@rasmusvillemoes.dk>
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 08:45:14 -0600 [thread overview]
Message-ID: <20260527144514.GE1858239@bill-the-cat> (raw)
In-Reply-To: <87a4tlji6v.fsf@prevas.dk>
[-- Attachment #1: Type: text/plain, Size: 1734 bytes --]
On Wed, May 27, 2026 at 11:49:28AM +0200, Rasmus Villemoes wrote:
> 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".
Honestly (and I mentioned this to David in his reply on the
devicetree-compiler list) the usage of the mask today is either 0xff or
0x0 and nothing in between. Which means yes, I wonder a little about the
can_assume macro as opposed to how the mask was used originally.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-05-27 14:45 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
2026-05-27 14:45 ` Tom Rini [this message]
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=20260527144514.GE1858239@bill-the-cat \
--to=trini@konsulko.com \
--cc=anton@binarly.io \
--cc=marek.vasut+renesas@mailbox.org \
--cc=rv@rasmusvillemoes.dk \
--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;
as well as URLs for NNTP newsgroup(s).