Devicetree Compiler
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] Revert "yamltree: Ensure consistent bracketing of properties with phandles"
Date: Wed, 29 Jan 2020 14:42:45 +1100	[thread overview]
Message-ID: <20200129034245.GZ42099@umbus.fritz.box> (raw)
In-Reply-To: <20200124144657.29749-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]

On Fri, Jan 24, 2020 at 08:46:57AM -0600, Rob Herring wrote:
> This reverts commit 18d7b2f4ee45fec422b7d82bab0b3c762ee907e4.

Applied, it looks like that commit was based on some pretty faulty
assumptions about how properties are structured.

> This doesn't work for properties such as 'interrupt-map' that has
> phandle in the middle of an entry. It would also not work for a 0 or -1
> phandle value that acts as a NULL.

I can't really make sense of that last sentence, though.

> 
> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
>  yamltree.c | 21 ---------------------
>  1 file changed, 21 deletions(-)
> 
> diff --git a/yamltree.c b/yamltree.c
> index 43ca869dd6a8..5b6ea8ea862f 100644
> --- a/yamltree.c
> +++ b/yamltree.c
> @@ -138,27 +138,6 @@ static void yaml_propval(yaml_emitter_t *emitter, struct property *prop)
>  		(yaml_char_t *)YAML_SEQ_TAG, 1, YAML_FLOW_SEQUENCE_STYLE);
>  	yaml_emitter_emit_or_die(emitter, &event);
>  
> -	/* Ensure we have a type marker before any phandle */
> -	for_each_marker(m) {
> -		int last_offset = 0;
> -		struct marker *type_m;
> -
> -		if (m->type >= TYPE_UINT8)
> -			last_offset = m->offset;
> -
> -		if (!(m->next && m->next->type == REF_PHANDLE &&
> -		      last_offset < m->next->offset))
> -			continue;
> -
> -		type_m = xmalloc(sizeof(*type_m));
> -		type_m->offset = m->next->offset;
> -		type_m->type = TYPE_UINT32;
> -		type_m->ref = NULL;
> -		type_m->next = m->next;
> -		m->next = type_m;
> -	}
> -
> -	m = prop->val.markers;
>  	for_each_marker(m) {
>  		int chunk_len;
>  		char *data = &prop->val.val[m->offset];

-- 
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 --]

      parent reply	other threads:[~2020-01-29  3:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 14:46 [PATCH] Revert "yamltree: Ensure consistent bracketing of properties with phandles" Rob Herring
     [not found] ` <20200124144657.29749-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2020-01-29  3:42   ` 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=20200129034245.GZ42099@umbus.fritz.box \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@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