From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: "Uwe Kleine-König"
<u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] dtc: When compiling to dts interpret /__symbols__ and /__local_fixups__
Date: Sun, 14 May 2023 16:30:41 +1000 [thread overview]
Message-ID: <ZGCAEd/w4T+Ad7oM@yekko> (raw)
In-Reply-To: <20230503210535.denueqhecvuedppv-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1914 bytes --]
On Wed, May 03, 2023 at 11:05:35PM +0200, Uwe Kleine-König wrote:
> Hello,
>
> On Fri, Apr 28, 2023 at 09:11:45PM +0200, Uwe Kleine-König wrote:
> > > > @@ -219,6 +219,9 @@ static void write_propval(FILE *f, struct property *prop)
> > > > if (emit_type == TYPE_NONE || chunk_len == 0)
> > > > continue;
> > > >
> > > > + if (m->offset != 0)
> > > > + fputc(' ', f);
> > >
> > > I'm not sure how this change is related to anything else.
> >
> > Without this, the resulting dts might have:
> >
> > clocks = <&clk 17&clk 19>;
> >
> > I think before my patch this never happend in practise because an array
> > never had more than one marker?!
>
> That hunk is wrong, but I don't see the right fix. A reproducer is:
>
> diff --git a/tests/type-preservation.dts b/tests/type-preservation.dts
> index 921ea21172d1..38e97cee6353 100644
> --- a/tests/type-preservation.dts
> +++ b/tests/type-preservation.dts
> @@ -18,6 +18,7 @@
> a-string-with-nulls = "foo\0bar", "baz";
> a-phandle = <&subsub1>;
> a-phandle-with-args = <&subsub1 0x00 0x01>, <&subsub1 0x02 0x03>;
> + another-phandle-with-args = <&subsub1 0x00 0x01 &subsub1 0x02 0x03>;
>
> subsub1: subsubnode {
> compatible = "subsubnode1", "subsubnode";
>
> Maybe you see the right thing to do?
Oof, finally got a chance to look at this. Thanks for the simple
reproducer. write_propval() is an even worse mess than I suspected
:(. I think I figured out a fix, which I've just committed as
3b02a94b486f998aa22d898b427820a805d0904f.
All that type preservation and yaml stuff is really ghastly though.
If you had a chance to submit poatches which tore it out, I'd be
pretty grateful.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2023-05-14 6:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 18:25 [PATCH] dtc: When compiling to dts interpret /__symbols__ and /__local_fixups__ Uwe Kleine-König
[not found] ` <20230426182558.573161-1-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2023-04-28 6:11 ` David Gibson
2023-04-28 19:11 ` Uwe Kleine-König
[not found] ` <20230428191130.nuibhzf3zjoqwpwm-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2023-05-03 14:06 ` David Gibson
2023-05-03 21:05 ` Uwe Kleine-König
[not found] ` <20230503210535.denueqhecvuedppv-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2023-05-14 6:30 ` David Gibson [this message]
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=ZGCAEd/w4T+Ad7oM@yekko \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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 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).