dtc: Return code of fdt_get_path()

David Gibson dwg at au1.ibm.com
Wed Aug 6 15:33:10 EST 2008


On Tue, Aug 05, 2008 at 04:12:22PM -0500, Scott Wood wrote:
> The documentation for fdt_get_path() says it returns zero on success,  
> but it actually returns the length of the string.  Is there any  
> preference on which one to fix?

The documentation I think.  There may be existing users, and the
length of the path is potentially useful.

Although.. I think the confusion came because at one stage I planned
to have it return the full length of the path, even if the buffer was
smaller.  That would let the caller allocate a buffer of exactly the
right size on a second call.  Which is potentially useful, but not
compatible with returning NOSPACE as we do now.

Plus.. looking over that code again, I think there may be more
problems there - I think there may be cases where it runs out of space
but returns BADOFFSET or some error code instead of NOSPACE.

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



More information about the devicetree-discuss mailing list