Re: [PATCH] yamltree: skip generated __symbols__, __local_fixups__ and __fixups__ nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Tue, Jan 29, 2019 at 10:31:10AM -0600, Rob Herring wrote:
> The generated __symbols__, __local_fixups__ and __fixups__ nodes don't
> have markers, so we can't generate YAML output for them. We don't care
> about them for YAML output anyways, so just skip over them.

This seems bogus - it makes assumptions about how the yaml output will
be used, and means it doesn't really get the same output as other
modes.

The __symbols__, __local_fixups__ and __fixups__ nodes have a known
format, which means we shouldn't need input from the front end about
how to interpret them.  Or to look at it another way, there's no
reason the code which generates them can't generate the type markers.

> 
> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
> ---
>  yamltree.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/yamltree.c b/yamltree.c
> index a00285a5a9ec..7b759448ff90 100644
> --- a/yamltree.c
> +++ b/yamltree.c
> @@ -205,6 +205,10 @@ static void yaml_tree(struct node *tree, yaml_emitter_t *emitter)
>  
>  	/* Loop over all the children, emitting them into the map */
>  	for_each_child(tree, child) {
> +		if (streq(child->name, "__symbols__") ||
> +		    streq(child->name, "__local_fixups__") ||
> +		    streq(child->name, "__fixups__"))
> +			continue;
>  		yaml_scalar_event_initialize(&event, NULL,
>  			(yaml_char_t *)YAML_STR_TAG, (yaml_char_t*)child->name,
>  			strlen(child->name), 1, 0, YAML_PLAIN_SCALAR_STYLE);

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


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux