Re: [PATCH 3/6] libfdt: overlay: rename-fragments

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



On Mon, Mar 19, 2018 at 05:42:17PM +1100, David Gibson wrote:
> On Fri, Mar 16, 2018 at 06:37:55PM +0530, Srivatsa Vaddagiri wrote:
[snip]
> >  int fdt_overlay_apply(void **fdt, void **fdto)
> >  {
> >  	uint32_t delta = fdt_get_max_phandle(*fdt);
> >  	int ret;
> > +	unsigned long max_fdto_fragments;
> >  
> >  	FDT_CHECK_HEADER(*fdt);
> >  	FDT_CHECK_HEADER(*fdto);
> >  
> >  	dprintf("Adjusting local phandles\n");
> > +	/* Does base blob have unresolved external references? */
> > +	if (!base_fixup_search_done) {
> > +		if (fdt_path_offset(*fdt, "/__fixups__") >= 0)
> > +			base_has_fixups = 1;
> > +		base_fixup_search_done = 1;
> > +	}
> 
> Yeah, this is gross, just use a different entry point for the two cases.

Oh, and it's also Just Plain Wrong.  Using the target-path syntax it's
entirely possible (though unusual) for an overlay not to have any
external fixups, so testing for it is not a reliable way to
distinguish overlays from base trees.

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