From patchwork Wed Oct 30 05:54:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3113241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7A9ECBF924 for ; Wed, 30 Oct 2013 05:55:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEA4D2020E for ; Wed, 30 Oct 2013 05:55:17 +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 BF60D20204 for ; Wed, 30 Oct 2013 05:55:16 +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 1VbOkH-0005Nt-BJ; Wed, 30 Oct 2013 05:55:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbOkE-0000IQ-T8; Wed, 30 Oct 2013 05:55:06 +0000 Received: from mail-bk0-x22c.google.com ([2a00:1450:4008:c01::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbOkC-0000Hw-KE for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2013 05:55:05 +0000 Received: by mail-bk0-f44.google.com with SMTP id mx11so285092bkb.3 for ; Tue, 29 Oct 2013 22:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MSRgtPDmGhMFYUhzVQ/jjdrEfCM8PqsiVAwrpleXHBM=; b=R9pMDMAoWLlEjdQwIbKAfWT3ST4Nm19HcVruwyYpDYIj+e0kLojcILSThgIw5FGOzz zHmWf11ojQzU6XmdhjQ0qFejNeVIRfOWB58WHfV0+MBNnd2ysHPJCIU8HNHplrekTQY5 dGDYVtJMNK0/FdbmyL9x0D4ETkIETmhki/xeWXSaC3yBa0Loou/MWEjzX8tUASiDQESP 91bBgqfvvLsZhV+3I6JUJgH4yA5LvM7rF73OG8+zGCfN7D2DkBFJ8qzWcgsIzfhHJ6cp S5igoG2/iaaTh+iKvfEjxanhXo6ooU26jR7Cabj4glokKst6PXAdRvink6PZDkQZ8W3K V+1A== MIME-Version: 1.0 X-Received: by 10.205.10.132 with SMTP id pa4mr1675651bkb.15.1383112481046; Tue, 29 Oct 2013 22:54:41 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Tue, 29 Oct 2013 22:54:40 -0700 (PDT) In-Reply-To: <52709A9E.8060800@gmail.com> References: <52709A9E.8060800@gmail.com> Date: Wed, 30 Oct 2013 13:54:41 +0800 Message-ID: Subject: [PATCH -next v2] arm64: use for_each_node_by_type() macro From: Wei Yongjun To: robherring2@gmail.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131030_015504_816103_61BC7F56 X-CRM114-Status: GOOD ( 11.57 ) X-Spam-Score: -2.0 (--) Cc: mark.rutland@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, rob.herring@calxeda.com, yongjun_wei@trendmicro.com.cn, grant.likely@linaro.org, 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 --- 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;