From mboxrd@z Thu Jan 1 00:00:00 1970 From: catalin.marinas@arm.com (Catalin Marinas) Date: Wed, 30 Oct 2013 12:16:11 +0000 Subject: [PATCH -next v2] arm64: use for_each_node_by_type() macro In-Reply-To: <5270F238.6010602@arm.com> References: <52709A9E.8060800@gmail.com> <5270F238.6010602@arm.com> Message-ID: <20131030121610.GJ3975@mbp> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Oct 30, 2013 at 11:49:12AM +0000, Sudeep KarkadaNagesha wrote: > On 30/10/13 05:54, Wei Yongjun wrote: > > From: Wei Yongjun > > > > Use for_each_node_by_type() macro instead of open coding it. > > > > Signed-off-by: Wei Yongjun > > --- > > v1 -> v2: remove extra space > > --- > > arch/arm64/kernel/cpu_ops.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/arm64/kernel/cpu_ops.c b/arch/arm64/kernel/cpu_ops.c > > index aa0c9e7..37a4977 100644 > > --- a/arch/arm64/kernel/cpu_ops.c > > +++ b/arch/arm64/kernel/cpu_ops.c > > @@ -78,10 +78,10 @@ int __init cpu_read_ops(struct device_node *dn, int cpu) > > > > void __init cpu_read_bootcpu_ops(void) > > { > > - struct device_node *dn = NULL; > > + struct device_node *dn; > > u64 mpidr = cpu_logical_map(0); > > > > - while ((dn = of_find_node_by_type(dn, "cpu"))) { > > + for_each_node_by_type(dn, "cpu") { > > u64 hwid; > > const __be32 *prop; > > > > In fact this function can be simplified by making use of OF helper directly, > something like below snippet. But it requires [1] for correct functionality. Thanks. Could you please send a properly formatted patch on top of [1]? -- Catalin