From patchwork Wed Apr 25 23:31:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 134397 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1534831lji; Wed, 25 Apr 2018 17:29:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx49onUwpPfJUheUTAFZkdVsr6T+W7PUHraB6ASBSQRdewq+fpNC1HIQS2+nsmROHkRf6B9+1 X-Received: by 2002:a17:902:41:: with SMTP id 59-v6mr31589939pla.345.1524702543673; Wed, 25 Apr 2018 17:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524702543; cv=none; d=google.com; s=arc-20160816; b=nY8eXI7OWwdicuXeZq0xU9l65mRxfH4nC2T1rS9CmDGg/eDgqsjH7ZYOYk7JMI89Tw F5lX6BmLy7UUb79LmgCrUj+VgY/TX+HO9A6vFGIQEWh8EI+UE//3p3Pcm90+L38mpk55 QYAN+5kHyEbzsaMhx9PkdmkM+5tn5gEm3vJGPvz3ZGJzozsIxs3FHqtN2woDipVF9/rc oKOPNeFptO5cX7V2JRMN2VO+FdCcp6xw6aYxmB1ZzaqvSh7pKJRdHSo6zZ1jTmBDsbVk T8KHVqQO+norMzzmm5HG4H40sz8bBTGhO1iBYaxqUaAqp78AFmqoKaWa70lOOrtJ1FFE rGmg== 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:arc-authentication-results; bh=QfvjFF+qDr64GIH2Y+rBZ0l2OScW6o++BReMvLKvZnU=; b=mH35seynDTeQ5pLZ7oCn3QxdKlqfu8fHRyQ4Uu3J+gZHCIulroc8ILQS5pqc2VfpBU cgOHkIBXiNBmn6wBpYVU2C8Y1kVuB6Dtf0B0qGZxhc+U8YFjtnpOWDXR20JYzGs3jTjl S67P0JaQx0c5XWlVG8tpm7k3wdPQGTRbcQM45PYNVWuXf+tCLkbtWdrFeJDbWszLfF1k Rd2ZrZUqbK5kwBYLsgZuJHVE3nsGzd4WS4tHQeqUIBCK7nWaZeBxNyaehCPoE8gANlVE f90pCq/l86kawnMEZyGX9A2OPVqmQbYX4T0coFToroiHsZ13vQvg19F4FiYhw/eZBZQ0 dmrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p66si1943118pga.180.2018.04.25.17.29.03; Wed, 25 Apr 2018 17:29:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752845AbeDZA3C (ORCPT + 8 others); Wed, 25 Apr 2018 20:29:02 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45592 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbeDZA0I (ORCPT ); Wed, 25 Apr 2018 20:26:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3F1FF15AD; Wed, 25 Apr 2018 17:26:08 -0700 (PDT) Received: from beelzebub.austin.arm.com (beelzebub.austin.arm.com [10.118.12.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2CBD13F590; Wed, 25 Apr 2018 17:26:07 -0700 (PDT) From: Jeremy Linton To: linux-acpi@vger.kernel.org Cc: Sudeep.Holla@arm.com, linux-arm-kernel@lists.infradead.org, Lorenzo.Pieralisi@arm.com, hanjun.guo@linaro.org, rjw@rjwysocki.net, Will.Deacon@arm.com, Catalin.Marinas@arm.com, gregkh@linuxfoundation.org, Mark.Rutland@arm.com, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, wangxiongfeng2@huawei.com, vkilari@codeaurora.org, ahs3@redhat.com, Dietmar.Eggemann@arm.com, Morten.Rasmussen@arm.com, palmer@sifive.com, lenb@kernel.org, john.garry@huawei.com, austinwc@codeaurora.org, tnowicki@caviumnetworks.com, jhugo@qti.qualcomm.com, timur@qti.qualcomm.com, ard.biesheuvel@linaro.org, Jeremy Linton Subject: [PATCH v8 01/13] drivers: base: cacheinfo: move cache_setup_of_node() Date: Wed, 25 Apr 2018 18:31:09 -0500 Message-Id: <20180425233121.13270-2-jeremy.linton@arm.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180425233121.13270-1-jeremy.linton@arm.com> References: <20180425233121.13270-1-jeremy.linton@arm.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org In preparation for the next patch, and to aid in review of that patch, lets move cache_setup_of_node further down in the module without any changes. Signed-off-by: Jeremy Linton Reviewed-by: Sudeep Holla --- drivers/base/cacheinfo.c | 80 ++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 40 deletions(-) -- 2.13.6 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index edf726267282..09ccef7ddc99 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -32,46 +32,6 @@ struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu) } #ifdef CONFIG_OF -static int cache_setup_of_node(unsigned int cpu) -{ - struct device_node *np; - struct cacheinfo *this_leaf; - struct device *cpu_dev = get_cpu_device(cpu); - struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); - unsigned int index = 0; - - /* skip if of_node is already populated */ - if (this_cpu_ci->info_list->of_node) - return 0; - - if (!cpu_dev) { - pr_err("No cpu device for CPU %d\n", cpu); - return -ENODEV; - } - np = cpu_dev->of_node; - if (!np) { - pr_err("Failed to find cpu%d device node\n", cpu); - return -ENOENT; - } - - while (index < cache_leaves(cpu)) { - this_leaf = this_cpu_ci->info_list + index; - if (this_leaf->level != 1) - np = of_find_next_cache_node(np); - else - np = of_node_get(np);/* cpu node itself */ - if (!np) - break; - this_leaf->of_node = np; - index++; - } - - if (index != cache_leaves(cpu)) /* not all OF nodes populated */ - return -ENOENT; - - return 0; -} - static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, struct cacheinfo *sib_leaf) { @@ -202,6 +162,46 @@ static void cache_of_override_properties(unsigned int cpu) cache_associativity(this_leaf); } } + +static int cache_setup_of_node(unsigned int cpu) +{ + struct device_node *np; + struct cacheinfo *this_leaf; + struct device *cpu_dev = get_cpu_device(cpu); + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); + unsigned int index = 0; + + /* skip if of_node is already populated */ + if (this_cpu_ci->info_list->of_node) + return 0; + + if (!cpu_dev) { + pr_err("No cpu device for CPU %d\n", cpu); + return -ENODEV; + } + np = cpu_dev->of_node; + if (!np) { + pr_err("Failed to find cpu%d device node\n", cpu); + return -ENOENT; + } + + while (index < cache_leaves(cpu)) { + this_leaf = this_cpu_ci->info_list + index; + if (this_leaf->level != 1) + np = of_find_next_cache_node(np); + else + np = of_node_get(np);/* cpu node itself */ + if (!np) + break; + this_leaf->of_node = np; + index++; + } + + if (index != cache_leaves(cpu)) /* not all OF nodes populated */ + return -ENOENT; + + return 0; +} #else static void cache_of_override_properties(unsigned int cpu) { } static inline int cache_setup_of_node(unsigned int cpu) { return 0; }