Devicetree
 help / color / mirror / Atom feed
From: David Gibson <dwg-8fk3Idey6ehBDgjK7y7TUQ@public.gmane.org>
To: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org
Subject: Re: dtc: Return code of fdt_get_path()
Date: Wed, 6 Aug 2008 15:33:10 +1000	[thread overview]
Message-ID: <20080806053310.GF6690@yookeroo.seuss> (raw)
In-Reply-To: <4898C236.5030305-KZfg59tc24xl57MIdRCFDg@public.gmane.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

  parent reply	other threads:[~2008-08-06  5:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05 21:12 dtc: Return code of fdt_get_path() Scott Wood
     [not found] ` <4898C236.5030305-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2008-08-06  5:33   ` David Gibson [this message]
     [not found]     ` <20080806053310.GF6690-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2008-08-07  6:08       ` David Gibson
     [not found]         ` <20080807060820.GA12571-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2008-08-12 15:57           ` Jon Loeliger
2008-08-12 23:15             ` David Gibson
2008-08-29  3:07           ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080806053310.GF6690@yookeroo.seuss \
    --to=dwg-8fk3idey6ehbdgjk7y7tuq@public.gmane.org \
    --cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox