From: Herve Codina <herve.codina@bootlin.com>
To: Simon Glass <sjg@chromium.org>
Cc: Devicetree Compiler <devicetree-compiler@vger.kernel.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v2 3/6] dtc: Clarify when delete placeholders are dropped
Date: Wed, 28 Oct 2026 18:56:17 +0100 [thread overview]
Message-ID: <20261028185617.12859066@bootlin.com> (raw)
In-Reply-To: <20261028093620.3705074-4-sjg@chromium.org>
Hi Simon,
On Wed, 28 Oct 2026 03:36:10 -0600
Simon Glass <sjg@chromium.org> wrote:
> The comment on drop_delete_placeholders() does not make clear which
> subtrees it is for. The call in merge_nodes() also relies on sections
> being merged in source order, since it drops the child's placeholders on
> the basis that nothing earlier remains to be merged, but nothing there
> says so.
>
> Say that drop_delete_placeholders() is for the first definition of a
> node, i.e. the first in the list of definitions which are merged
> together. Explain at the call in merge_nodes() why the child is the
> first definition, and that merging is not associative.
>
> Suggested-by: David Gibson <david@gibson.dropbear.id.au>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2:
> - Add new patch to clarify the comments
>
> livetree.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/livetree.c b/livetree.c
> index 6609e4e..b7a5161 100644
> --- a/livetree.c
> +++ b/livetree.c
> @@ -122,8 +122,10 @@ static void apply_deletes(struct node *node)
>
> /*
> * Drop the /delete-property/ and /delete-node/ placeholders from a subtree
> - * which joins the tree without being merged, since there is nothing earlier
> - * for them to delete
> + * which is the first definition of its node, i.e. the first in the list of
> + * definitions which are merged together. apply_deletes() has already dropped
> + * what they delete within the subtree, and there is nothing earlier for them
> + * to delete
> */
> void drop_delete_placeholders(struct node *node)
> {
> @@ -273,6 +275,14 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node)
>
> /* if no collision occurred, add child to the old node. */
> if (new_child) {
> + /*
> + * This is the first definition of the child, since
> + * sections are merged in source order, so its
> + * placeholders have nothing to delete. This is
> + * important since dropping them makes merging not
> + * associative: merging later sections together first
> + * would lose their deletes
> + */
> drop_delete_placeholders(new_child);
> add_child(old_node, new_child);
> }
drop_delete_placeholders() has been added in patch 1.
Why those both modification related to comment here in patch 3
Worth noting that patch 2 is only related to tests.
IHMO, this patch should be squashed in patch 1.
Best regards,
Hervé
next prev parent reply other threads:[~2026-10-28 17:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 9:36 [PATCH v2 0/6] dtc: Fix deletes within a section and before a redefinition Simon Glass
2026-10-28 9:36 ` [PATCH v2 1/6] dtc: Apply deletes in the section which has them Simon Glass
2026-10-28 9:36 ` [PATCH v2 2/6] dtc: Remove a deleted node or property from the tree Simon Glass
2026-10-28 9:36 ` [PATCH v2 3/6] dtc: Clarify when delete placeholders are dropped Simon Glass
2026-10-28 17:56 ` Herve Codina [this message]
2026-10-29 8:59 ` Simon Glass
2026-10-28 9:36 ` [PATCH v2 4/6] tests: Allow dtc-fatal.sh to check the error message Simon Glass
2026-10-28 18:02 ` Herve Codina
2026-10-29 7:21 ` Herve Codina
2026-10-29 9:01 ` Simon Glass
2026-10-28 9:36 ` [PATCH v2 5/6] dtc: Report an error for a delete in an overlay fragment Simon Glass
2026-10-28 18:17 ` Herve Codina
2026-10-29 9:04 ` Simon Glass
2026-10-28 9:36 ` [PATCH v2 6/6] doc: dts-format: Describe later definitions and deletes Simon Glass
2026-10-28 18:25 ` Herve Codina
2026-10-29 9:06 ` Simon Glass
2026-10-29 2:49 ` [PATCH v2 0/6] dtc: Fix deletes within a section and before a redefinition David Gibson
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=20261028185617.12859066@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=david@gibson.dropbear.id.au \
--cc=devicetree-compiler@vger.kernel.org \
--cc=sjg@chromium.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.