From patchwork Wed Feb 1 23:01:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 9550765 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 79BDB60424 for ; Wed, 1 Feb 2017 23:02:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7420328305 for ; Wed, 1 Feb 2017 23:02:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6815428450; Wed, 1 Feb 2017 23:02:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F1AE928305 for ; Wed, 1 Feb 2017 23:02:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cZ3v6-0004Lw-N9; Wed, 01 Feb 2017 23:02:32 +0000 Received: from mail-pg0-f66.google.com ([74.125.83.66]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cZ3v3-0004L3-SZ for linux-arm-kernel@lists.infradead.org; Wed, 01 Feb 2017 23:02:31 +0000 Received: by mail-pg0-f66.google.com with SMTP id 194so35444858pgd.0 for ; Wed, 01 Feb 2017 15:02:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=cXRzVTphRavDtGogpV/DkHCwhCJJUGCjqBBFVMuKgic=; b=oq99JIBq91od0VfOLQkJOo9fElelgJdwU8pPkZ8zkU6zneHlJ2JXeI+TsfD6Ym8nyd /WzlAU9cT0Xk2PUXX+39jn5qneUYxpVcJLyJWvuuENUAEPqGcEkKgQ9RYlYGCnu5T5JD qTAgMX3uNiw/txXYUMc3+Y80NA6pCG4neHk++3KnaKEnojWEu67KQLqQqTrAvbrItrAQ eVfa8tD84ErNS23ZRzACIT60Tua8J0vvpgipGhKzDsuTyLw4z7E0hPnXQyMVMyhJwyWj lba3yIXP0zb0dP+44XE+qdFWR9vvlQHDWyozU231Xmkr6axdpoCGFAKmX1uOwYCM+xdU 2tXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=cXRzVTphRavDtGogpV/DkHCwhCJJUGCjqBBFVMuKgic=; b=FNl/8ggksh6KqvEWXT8GekbYPVsGMbyTQG22bGDMUma7A3OwGnPU7/nK7BcVuo8uwJ GuTkIBzHgUxwgF+zTb4nKxO067Q0dAOkrmDr3QUiD9xxyO2ZGedQNH3jz482cY3imdcU ilk98Ei9yFq6dspFg2czD7ScuRPvEWhyIApZHcVoBU/BqZUDoO7FmwSfM9F9vZdNil3P qwTEX2KhONw9VnmUPRrtNZgokaVsP823VZ6LI1guNDUs0ROTFQNetGrFBDWq20U3oBrj c7y4Ha3LX++3A+kGCqEtcE4nmGNq05LE2O1xH297LybTwUpFwEvFnub/q4NTWOKQjA0+ 8M3Q== X-Gm-Message-State: AIkVDXIXmJVXd7sK45QAZLLZMyTqwksWna7WkVGEFhrWiTtkTYdJPIuXlXjLzvMUBBI2Bw== X-Received: by 10.84.147.71 with SMTP id r7mr7949215ple.48.1485990068341; Wed, 01 Feb 2017 15:01:08 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1311:4916:fdca:51f:9afb]) by smtp.gmail.com with ESMTPSA id 82sm52694805pge.42.2017.02.01.15.01.07 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 01 Feb 2017 15:01:07 -0800 (PST) Date: Wed, 1 Feb 2017 15:01:05 -0800 From: Dmitry Torokhov To: Catalin Marinas Subject: [PATCH] arm64: make use of for_each_node_by_type() Message-ID: <20170201230105.GA32086@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170201_150229_978764_CFA6CD7E X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of open-coding the loop, let's use canned macro. Signed-off-by: Dmitry Torokhov --- This will also be needed if I manage to make of_find_node_by_type() stop dropping reference to starting node as it is quite unexpected thing to do. arch/arm64/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index cb87234cfcf2..a8ec5da530af 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -603,9 +603,9 @@ acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header, */ static void __init of_parse_and_init_cpus(void) { - struct device_node *dn = NULL; + struct device_node *dn; - while ((dn = of_find_node_by_type(dn, "cpu"))) { + for_each_node_by_type(dn, "cpu") { u64 hwid = of_get_cpu_mpidr(dn); if (hwid == INVALID_HWID)