Received: by 10.223.185.116 with SMTP id b49csp6710924wrg; Wed, 28 Feb 2018 14:11:46 -0800 (PST) X-Google-Smtp-Source: AH8x226Kqb0IQXfKeSbO9+Qa3JhPNKjdLDaEeUz/okHiHHT2y/RJr9Nkpu1LkXhk8Hz8OIuo4kWG X-Received: by 10.98.242.6 with SMTP id m6mr19009988pfh.230.1519855906871; Wed, 28 Feb 2018 14:11:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519855906; cv=none; d=google.com; s=arc-20160816; b=Z9l6Fk4vWBPx/hnaDBa+mrszI+SrChWL/FpwNoeGsrbYCIIz4ED7oOkdaCj+EpBbYk SV2AuHVuj7j3BHohv76WgCocoEkbEakCMHI+hHUjYwx9fRttLelmTxRHavDTbn6UqHwO TMQs8O8A15JfxLeIZbC7ucZz2jsO4XFrqXcPTwgckSDc84b9OPc7M8OOXTq+cvYimJR9 Aq5ae3cU1HfQtPd1Jcs/ar7NAV7CZGOnWx73No0V75Ns87huhkzXkX8TXS0ZaQLqMCMS vT0HolUBuPxq5ub3+sUUTbQRRl6SHPHAmPkiTvCDY+gWhbQiSfKamEsuvR+1MN4pAFqR OQuQ== 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=RRkUghi/VYTokt7oDldjgKvni1G8OPv/dexXLnqGdSg=; b=ySNo9upWdZcoMWvp9/KVx6sKBFTcxBb0aS4+tma6Rjt4USqPpggSONuRydGdc219hf PnufnG6fUg4yCgxQYo6RfGelh9PS37dSLZMNJ9csRtcwJ6sGrC0vOaRKY0Ugs99bJPQv xtgwWAdzLXR9pUCCCbTX/qChJFSHVOAFjJPn3PJrRN6gkChHKKPwIw6vpBcg989zrhuL fKubDvDXtowYCuFPLtTe7k/C/ha05wF9vpxm4QtlAF2bxOPOnMXoN+4RKRL7MYWD/LQl 4jIdNubGkCtCaDq4OHUbIJ4Smih3y58SGm/yLF0bu3fr+rQBG4jg/Eje4wX+XiqxOdEN OQag== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u188si1542325pgb.648.2018.02.28.14.11.32; Wed, 28 Feb 2018 14:11:46 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935302AbeB1WHQ (ORCPT + 99 others); Wed, 28 Feb 2018 17:07:16 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:57926 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935105AbeB1WHN (ORCPT ); Wed, 28 Feb 2018 17:07:13 -0500 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 DF9EA15BF; Wed, 28 Feb 2018 14:07:12 -0800 (PST) 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 E7C783F246; Wed, 28 Feb 2018 14:07:11 -0800 (PST) From: Jeremy Linton To: linux-acpi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, 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, Jeremy Linton Subject: [PATCH v7 01/13] drivers: base: cacheinfo: move cache_setup_of_node() Date: Wed, 28 Feb 2018 16:06:07 -0600 Message-Id: <20180228220619.6992-2-jeremy.linton@arm.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180228220619.6992-1-jeremy.linton@arm.com> References: <20180228220619.6992-1-jeremy.linton@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- drivers/base/cacheinfo.c | 80 ++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 40 deletions(-) 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; } -- 2.13.6