From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: dtc: Return code of fdt_get_path() Date: Wed, 6 Aug 2008 15:33:10 +1000 Message-ID: <20080806053310.GF6690@yookeroo.seuss> References: <4898C236.5030305@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <4898C236.5030305-KZfg59tc24xl57MIdRCFDg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org To: Scott Wood Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org List-Id: devicetree@vger.kernel.org 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