From da2b691ccf6863b2f5039d98e71f09d4244e5aa1 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 10 Oct 2018 10:19:30 -0500 Subject: [PATCH] treesource: Fix dts output for phandles in middle of a sequence of ints If we have a phandle in the middle of a sequence of numbers and it is not bracketed (e.g. <0x1234 &phandle 0x5678>), the dts output will be corrupted due to missing a space between the phandle value and the following number. Fixes: 8c59a97ce096 ("Fix missing labels when emitting dts format") Cc: Grant Likely Signed-off-by: Rob Herring Signed-off-by: David Gibson --- treesource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/treesource.c b/treesource.c index 93fd8ac..1529a0a 100644 --- a/treesource.c +++ b/treesource.c @@ -239,10 +239,10 @@ static void write_propval(FILE *f, struct property *prop) if (has_data_type_information(m)) { emit_type = m->type; fprintf(f, " %s", delim_start[emit_type]); - } - - if (m->type == LABEL) + } else if (m->type == LABEL) fprintf(f, " %s:", m->ref); + else if (m->offset) + fputc(' ', f); if (emit_type == TYPE_NONE) { assert(chunk_len == 0);