[Pdbg] [PATCH 07/13] libpdbg: Do not store properties in linked list

Amitay Isaacs amitay at ozlabs.org
Thu Jan 16 13:43:04 AEDT 2020


On Thu, 2020-01-16 at 12:38 +1100, Alistair Popple wrote:
> >  static void dt_link_virtual(struct pdbg_target *node, struct
> > pdbg_target
> > *vnode) {
> > -	struct dt_property *prop = NULL, *next;
> > -
> >  	node->vnode = vnode;
> >  	vnode->vnode = node;
> > -
> > -	/* Move any properties on virtual node to real node */
> > -	list_for_each_safe(&vnode->properties, prop, next, list) {
> > -		if (!strcmp(prop->name, "#address-cells") ||
> > !strcmp(prop->name,
> > "#size-cells")) -			continue;
> > -
> > -		list_del(&prop->list);
> > -		list_add_tail(&node->properties, &prop->list);
> > -	}
> 
> We're changing the behaviour here right? We should probably figure
> out why we 
> did this and make sure it's safe to stop doing it, or change the
> property 
> reading code to make sure it looks at the virtual node as well when
> trying to 
> access properties.

I did think about this.  The attributes will always be defined for
system tree nodes and those are the nodes returned by most of the api
functions.

The other case is using the properties for the backend nodes as
required for address translation etc. But in those cases we explicitly
look for backend nodes.

I am sure there might be some corner cases I have missed.  We can take
care of them as we encounter them.

> 
> - Alistair
> 
> >  }
> > 
> >  static void pdbg_targets_init_virtual(struct pdbg_target *node,
> > struct
> > pdbg_target *root)
> 
> 
> 

Amitay.
-- 

If you're looking for a big opportunity, seek out a big problem.



More information about the Pdbg mailing list