public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Paul Mackerras <paulus@samba.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [RFC] PPC: add for_each_node_child() macro
Date: Sat, 17 Nov 2007 00:10:02 +0300	[thread overview]
Message-ID: <20071116211002.GC7710@cvg> (raw)

This patch adds usefull macro to iterate over a node childs.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
TODO: convert all for(...) cycles to this macro.

 include/linux/of.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/of.h b/include/linux/of.h
index 5c39b92..a93e2aa 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -46,6 +46,8 @@ extern struct device_node *of_find_node_by_phandle(phandle handle);
 extern struct device_node *of_get_parent(const struct device_node *node);
 extern struct device_node *of_get_next_child(const struct device_node *node,
 					     struct device_node *prev);
+#define for_each_node_child(dn, child) \
+	for (child = NULL; (child = of_get_next_child(dn, child)); )
 extern struct property *of_find_property(const struct device_node *np,
 					 const char *name,
					 int *lenp);


                 reply	other threads:[~2007-11-16 21:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20071116211002.GC7710@cvg \
    --to=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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