From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470AbbJKUo3 (ORCPT ); Sun, 11 Oct 2015 16:44:29 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:26851 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751793AbbJKUo2 (ORCPT ); Sun, 11 Oct 2015 16:44:28 -0400 X-IronPort-AV: E=Sophos;i="5.17,669,1437429600"; d="scan'208";a="182200017" Date: Sun, 11 Oct 2015 22:44:25 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Christophe JAILLET cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] powerpc/mpc5xxx: Use of_get_next_parent to simplify code In-Reply-To: <1444595260-3332-1-git-send-email-christophe.jaillet@wanadoo.fr> Message-ID: References: <1444595260-3332-1-git-send-email-christophe.jaillet@wanadoo.fr> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 11 Oct 2015, Christophe JAILLET wrote: > of_get_next_parent can be used to simplify the while() loop and > avoid the need of a temp variable. Can you do something with the loop in __of_translate_address, in drivers/of/address.c? Is there not an iterator for this? julia > > Signed-off-by: Christophe JAILLET > --- > arch/powerpc/sysdev/mpc5xxx_clocks.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/arch/powerpc/sysdev/mpc5xxx_clocks.c b/arch/powerpc/sysdev/mpc5xxx_clocks.c > index f4f0301..5732926 100644 > --- a/arch/powerpc/sysdev/mpc5xxx_clocks.c > +++ b/arch/powerpc/sysdev/mpc5xxx_clocks.c > @@ -13,7 +13,6 @@ > > unsigned long mpc5xxx_get_bus_frequency(struct device_node *node) > { > - struct device_node *np; > const unsigned int *p_bus_freq = NULL; > > of_node_get(node); > @@ -22,9 +21,7 @@ unsigned long mpc5xxx_get_bus_frequency(struct device_node *node) > if (p_bus_freq) > break; > > - np = of_get_parent(node); > - of_node_put(node); > - node = np; > + node = of_get_next_parent(node); > } > of_node_put(node); > > -- > 2.1.4 > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >