[Skiboot] [PATCH 1/4] hdata/hdata_to_dt.c: Also print node names.

Jeremy Kerr jk at ozlabs.org
Mon Jan 18 12:11:08 AEDT 2016


Hi Oliver,

> Currently the hdata_to_dt script will only dump the node properties.
> This change adds a "node: <name>" line to the default output and adds
> the -t flag to only print the node names, without properties.

Makes sense.

> -static void dump_dt(const struct dt_node *root, unsigned indent)
> +static void dump_dt(const struct dt_node *root, unsigned indent, bool show_props)

Can you trim this to 80 chars?

>  {
>  	const struct dt_node *i;
>  	const struct dt_property *p;
> +	
> +	indent_num(indent);
> +	printf("node: %s\n", root->name);

Minor not: it might be better to indent after the node definition,
rather than before. So we get:

 node: parent
   prop: prop1
   prop: prop2
   node: child
     prop: prop3
     prop: prop4

instead of:

 node: parent
 prop: prop1
 prop: prop2
  node: child
  prop: prop3
  prop: prop4

.. but this is pretty trivial.

Cheers,


Jeremy


More information about the Skiboot mailing list