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:
signature.asc
Description: PGP signature