Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp114imm; Wed, 5 Sep 2018 12:39:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdazCvh+BcZi0MPx3XeZk0YPZECP+kGdobjURwCo0GQofQX3XVj/otJwTuEX2ief5yVD3qdD X-Received: by 2002:a65:60cf:: with SMTP id r15-v6mr36392012pgv.41.1536176398032; Wed, 05 Sep 2018 12:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536176398; cv=none; d=google.com; s=arc-20160816; b=mehBzBZ8wRXNnkFulqGJq1914yU1IdSTx9d+JOoKsimuBF7rqD83PM03wsjw6wAJdD NBG0C3d8dbAHekeqR8Az1ps7UU81t450W154+d8Ttx6g+6nl9n5Tlor18dIT0ZqLyX3g KBdQ/kimVvqHOu/LwnQadwK2lxg3oRa9eQzra17XTGgJIrJI4/0ElPzJzUf+N8ZktBuI o3PGm23xL3yEWsKaSJL1LxXSlqik6riiBY4jKG0j9B7lrSxjyuGXMcZJTHIutFUHhdWQ raDCtWSAmyWNPzMK9VYGWu+u43PES7xtq00CWI+JQ2JD9eQNTIX9Jm/Lmc9iBqb8dveW 2D1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=XSLGQ9uqdAn4wTY6t09Z9k1WYMJrEeRcoehNp+zGb14=; b=Q+rjbu5sZ633FJ+MvJRW/ipiwztsp8112kvQAzqf8+kh8earDBdXjfyjwKoPeTSLe6 v6f0Bl8/d8UWyqpxiy1YqHBfgsk+YmjGnchtEkoaUdpcxnY0EE+G8D1ithPXx46XIUg0 lBjkfsRiJKXOL6PIqfpQ2XILL/Hbp3rU2TAn0ehJOKQYmi6/TcKquv1V80sniZzPit4y w4uVYd9xGfBV2j986dPEcr2dum5xBY4z31QN1yEGJHj2XxxLrBCYIiSyU1Embyq/2bzN /heYtt49ZnC8ZFsV/Ms4uIcfDfklx0Po3+QolTrsJ96ALlwc/FVBPunQClBfqP7XRrlg /m0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p21-v6si2561513plq.338.2018.09.05.12.39.33; Wed, 05 Sep 2018 12:39:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728259AbeIFAJm (ORCPT + 99 others); Wed, 5 Sep 2018 20:09:42 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:42571 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728237AbeIFAJl (ORCPT ); Wed, 5 Sep 2018 20:09:41 -0400 Received: by mail-oi0-f65.google.com with SMTP id k81-v6so15916221oib.9; Wed, 05 Sep 2018 12:38:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XSLGQ9uqdAn4wTY6t09Z9k1WYMJrEeRcoehNp+zGb14=; b=qOnEtPzxHa9mvw8XvkK4/zDt5kveZn+IfJIBlXQS8AHq9iAx5Vx8pFQxSbNTSuviaE hsCQgW/fEWchWRYMJ3ATA/HW7xr5pOTfg7zojNYjmwvTtYaJXq4tOB3y43A6P+iBahQE npg8XR3W30eh5HzxgnStOaPrBskRpljUytEFLMSNZzYhQDXq9fYZ1hCeNEAXUp2FeZu0 C9ZCMwRSDnj0VIHbXYafAfCka6r98TiZaph1IWcN6FTUoUbNr0S3628j1kYzmZ3vzTqO yAOP9Q/epiwiy/8O3tFlp5xdkZAsPNyyHpcTMKcM+o5cZNR2a5fyWtQdT4nKEt645ycI 1Rhg== X-Gm-Message-State: APzg51DPv/hSkJZ5XX+2Td1eRTFAU1sbm1OeS/uGf/gvY0anPXRhwjpH G6eyhOZZ/QTMclocbx4cwtaNQ+Y= X-Received: by 2002:aca:3fc2:: with SMTP id m185-v6mr31989616oia.240.1536176283327; Wed, 05 Sep 2018 12:38:03 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id u21-v6sm2296053oie.22.2018.09.05.12.38.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 12:38:02 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Frank Rowand Subject: [PATCH 20/21] of: use for_each_of_cpu_node iterator Date: Wed, 5 Sep 2018 14:37:37 -0500 Message-Id: <20180905193738.19325-21-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905193738.19325-1-robh@kernel.org> References: <20180905193738.19325-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This has the side effect of defaulting to iterating using "cpu" node names in preference to the deprecated (for FDT) device_type == "cpu". Cc: Frank Rowand Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring --- Please ack and I will take via the DT tree. This is dependent on the first 2 patches. drivers/of/base.c | 2 +- drivers/of/of_numa.c | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 6389aeb2f48c..8285c07cab44 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -389,7 +389,7 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) { struct device_node *cpun; - for_each_node_by_type(cpun, "cpu") { + for_each_of_cpu_node(cpun) { if (arch_find_n_match_cpu_physical_id(cpun, cpu, thread)) return cpun; } diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 27d9b4bba535..f165fe28f49d 100644 --- a/drivers/of/of_numa.c +++ b/drivers/of/of_numa.c @@ -24,18 +24,9 @@ static void __init of_numa_parse_cpu_nodes(void) { u32 nid; int r; - struct device_node *cpus; - struct device_node *np = NULL; - - cpus = of_find_node_by_path("/cpus"); - if (!cpus) - return; - - for_each_child_of_node(cpus, np) { - /* Skip things that are not CPUs */ - if (of_node_cmp(np->type, "cpu") != 0) - continue; + struct device_node *np; + for_each_of_cpu_node(np) { r = of_property_read_u32(np, "numa-node-id", &nid); if (r) continue; @@ -46,8 +37,6 @@ static void __init of_numa_parse_cpu_nodes(void) else node_set(nid, numa_nodes_parsed); } - - of_node_put(cpus); } static int __init of_numa_parse_memory_nodes(void) -- 2.17.1