From: Huang Shijie <b32955@freescale.com>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: dwmw2@infradead.org, grant.likely@linaro.org,
rob.herring@calxeda.com, devicetree@vger.kernel.org,
yongjun_wei@trendmicro.com.cn, linux-mtd@lists.infradead.org
Subject: Re: [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro
Date: Fri, 23 Aug 2013 15:42:52 +0800 [thread overview]
Message-ID: <5217127C.3050602@freescale.com> (raw)
In-Reply-To: <CAPgLHd_zSXzRWGgQUzsmsM4beiTFKoWtcic6QmJdxhfBvNEZYg@mail.gmail.com>
于 2013年08月23日 11:04, Wei Yongjun 写道:
> From: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
>
> Use for_each_child_of_node() macro instead of open coding it.
>
> Signed-off-by: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
> ---
> drivers/mtd/ofpart.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
> index 7843a44..d64f8c3 100644
> --- a/drivers/mtd/ofpart.c
> +++ b/drivers/mtd/ofpart.c
> @@ -43,9 +43,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
> return 0;
>
> /* First count the subnodes */
> - pp = NULL;
> nr_parts = 0;
> - while ((pp = of_get_next_child(node, pp))) {
> + for_each_child_of_node(node, pp) {
> if (node_has_compatible(pp))
> continue;
>
> @@ -59,9 +58,8 @@ static int parse_ofpart_partitions(struct mtd_info *master,
> if (!*pparts)
> return -ENOMEM;
>
> - pp = NULL;
> i = 0;
> - while ((pp = of_get_next_child(node, pp))) {
> + for_each_child_of_node(node, pp) {
> const __be32 *reg;
> int len;
> int a_cells, s_cells;
Acked-by: Huang Shijie <b32955@freescale.com>
next prev parent reply other threads:[~2013-08-23 7:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 3:04 [PATCH -next] mtd: ofpart: use for_each_child_of_node() macro Wei Yongjun
2013-08-23 7:42 ` Huang Shijie [this message]
2013-08-24 5:10 ` Brian Norris
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=5217127C.3050602@freescale.com \
--to=b32955@freescale.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=grant.likely@linaro.org \
--cc=linux-mtd@lists.infradead.org \
--cc=rob.herring@calxeda.com \
--cc=weiyj.lk@gmail.com \
--cc=yongjun_wei@trendmicro.com.cn \
/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;
as well as URLs for NNTP newsgroup(s).