All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>
To: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org
Subject: Re: [1/2] libfdt: Rework fdt_next_node()
Date: Fri, 06 Feb 2009 11:21:41 -0600	[thread overview]
Message-ID: <E1LVUOb-0000PN-Jp@jdl.com> (raw)
In-Reply-To: <20090206030156.GG18397-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>

> Currently fdt_next_node() will find the next node in the blob
> regardless of whether it is above, below or at the same level in the
> tree as the starting node - the depth parameter is updated to indicate
> which is the case.  When a depth parameter is supplied, this patch
> makes it instead terminate immediately when it finds the END_NODE tag
> for a node at depth 0.  In this case it returns the offset immediately
> past the END_NODE tag.
> 
> This has a couple of advantages.  First, this slightly simplifies
> fdt_subnode_offset(), which no longer needs to explicitly check that
> fdt_next_node()'s iteration hasn't left the starting node.  Second,
> this allows fdt_next_node() to be used to implement
> _fdt_node_end_offset() considerably simplifying the latter function.
> 
> The other users of fdt_next_node() either don't need to iterate out of
> the starting node, or don't pass a depth parameter at all.  Any
> callers that really need to iterate out of the starting node, but keep
> tracking depth can do so by biasing the initial depth value.
> 
> This is a semantic change, but I think it's very unlikely to break any
> existing library users.
> 
> Signed-off-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>

Applied.

Thanks,
jdl

  parent reply	other threads:[~2009-02-06 17:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06  2:49 [0/2] libfdt: Cleanups to iteration functions [resend] David Gibson
     [not found] ` <20090206024929.GC18397-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-02-06  3:01   ` [1/2] libfdt: Rework fdt_next_node() David Gibson
     [not found]     ` <20090206030156.GG18397-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-02-06  3:03       ` [2/2] libfdt: Rework/cleanup fdt_next_tag() David Gibson
     [not found]         ` <20090206030324.GH18397-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-02-06 17:22           ` Jon Loeliger
2009-02-06 17:21       ` Jon Loeliger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-11-11 12:18 [0/2] libfdt: Cleanups to iteration functions David Gibson
     [not found] ` <20081111121804.GH26376-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2008-11-11 12:19   ` [1/2] libfdt: Rework fdt_next_node() 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=E1LVUOb-0000PN-Jp@jdl.com \
    --to=jdl-cyomk+44s/e@public.gmane.org \
    --cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
    --cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.