From patchwork Wed Oct 30 05:25:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3113081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D07C89F3E2 for ; Wed, 30 Oct 2013 05:26:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23E69201F4 for ; Wed, 30 Oct 2013 05:26:03 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 40293201E9 for ; Wed, 30 Oct 2013 05:26:02 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbOI2-0001VE-Sb; Wed, 30 Oct 2013 05:25:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbOI0-0006GP-Cz; Wed, 30 Oct 2013 05:25:56 +0000 Received: from mail-bk0-x232.google.com ([2a00:1450:4008:c01::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbOHy-0006FJ-3e for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2013 05:25:54 +0000 Received: by mail-bk0-f50.google.com with SMTP id v4so337235bkz.9 for ; Tue, 29 Oct 2013 22:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=xB3+st5jDrMG0ONw8oU5w1aWHzn+LQtf0Qi09Ol7qFY=; b=GN6hyqdA6mMpMoMzvRWyVxCfSGxwm/F5ubh8NUHNr+SlY0NSq31JGmUBVtzVLrCpKd FTJAGCh+XyKomsItvg0wIvnriEwB20HKQsqXnqlDOKroHUTPFaaxFVKst4HJO8iBCJ0/ XSb/OaA2c+9GbEoefcdnAwwkO28ki51zt7UUmdysKt+tYB1AwQOT4VewakmuCuBwKJ3s q0MBK1AR4rCi2tja88p7yRR8IE8tbmpaGZKY4uuCGupK85yy8TG9FtPp53wavL7dPrsi HpHEfyRjbKvR0vkp/JFYxpRw0JnlcTQmDTk5qS8T0+bEvusL4bf0pVyq2R2gGh8bD0Ne gIqw== MIME-Version: 1.0 X-Received: by 10.204.69.202 with SMTP id a10mr105182bkj.36.1383110732185; Tue, 29 Oct 2013 22:25:32 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Tue, 29 Oct 2013 22:25:32 -0700 (PDT) Date: Wed, 30 Oct 2013 13:25:32 +0800 Message-ID: Subject: [PATCH -next] arm64: use for_each_node_by_type() macro From: Wei Yongjun To: catalin.marinas@arm.com, will.deacon@arm.com, grant.likely@linaro.org, rob.herring@calxeda.com, mark.rutland@arm.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131030_012554_302218_83970754 X-CRM114-Status: GOOD ( 10.49 ) X-Spam-Score: -2.0 (--) Cc: yongjun_wei@trendmicro.com.cn, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Use for_each_node_by_type() macro instead of open coding it. Signed-off-by: Wei Yongjun --- 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;