Re: [PATCH v3] libfdt: Add phandle generation helper

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



On Fri, Mar 22, 2019 at 04:47:34PM -0700, Frank Rowand wrote:
> Hi David,
> 
> On 3/20/19 5:38 PM, David Gibson wrote:
> > On Wed, Mar 20, 2019 at 04:10:03PM +0100, Thierry Reding wrote:
> >> From: Thierry Reding <treding@xxxxxxxxxx>
> >>
> >> The new fdt_generate_phandle() function can be used to generate a new,
> >> unused phandle given a specific device tree blob. The implementation is
> >> somewhat naive in that it simply walks the entire device tree to find
> >> the highest phandle value and then returns a phandle value one higher
> >> than that. A more clever implementation might try to find holes in the
> >> current set of phandle values and fill them. But this implementation is
> >> relatively simple and works reliably.
> >>
> >> Also add a test that validates that phandles generated by this new API
> >> are indeed unique.
> >>
> >> Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
> > 
> > Applied, thanks.
> 
> I would like for you to think of possibly reverting this patch.  Or doing
> so in about two weeks.  I have started discussing with Thierry whether
> there is better way of handling the use case.  But I am going to be off
> grid for a week, so that conversation will be on hold.

I have reverted it for now.  I'm not really sure I'm convinced by your
arguments in the thread (though I'm still reading).

But, I'd forgotten that we already had an exposed
fdt_get_max_phandle() function.  I don't see that the
fdt_generate_phandle() function really adds much to that.

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