Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp441418ybt; Wed, 1 Jul 2020 02:10:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMpa4lq5BSjNjYgVqt6TOrr1SX75fIzjnUUtknoyUf9yqcecGkuKmaotlM1N8uzbdjiP/e X-Received: by 2002:a17:906:1986:: with SMTP id g6mr9827576ejd.404.1593594651277; Wed, 01 Jul 2020 02:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593594651; cv=none; d=google.com; s=arc-20160816; b=0h9vS/Uw0rOYL+YG7lcE2Kb3rtDDw9PIxWvdnV1AUcX8WDfmyNS5DyqGeeHfH/6nLH a/rkJ0oZiSRqabn+YpVkUnhpm6ZcwlIlYoMoywC7Ltu4ivuq0b5LYPwT815QqzyXwU16 /tiL0o2wWKcIl+EK+ggGA/vT5wRYOIWQSVoWi/OHV7YzzqXFhM1d61Wn28bIHpnAcIlF UCWlt67NwZ/UZmhYtMG7BJWpBL05OxxdOWwxrKVKKqJM8zbyyJb6EIXhAZAhv3dFZwdF x2oQjsdxJaY0G4prulS6nH7KaFix0Kw6qpSJdvyF2Svxb8ZIFBBL/yvYayFk18eQV1BB cqcA== 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=ZwUl/0GNh+xB6hASgL6krUwvlDxo3vJK+xD7XvzY7gw=; b=ravwO6TMZf4+HiWuulS7Mllj3x53WiXW1Fv5NxCwnQ09EYoLNNj8jEdSmNbgVKhNsj UHg+zh2HQuAm8jx3qgkIzpcX9zlrHj/GsjZ7e4uHOQ74tUlSzUe9rZjzEiQi2jS99wxr ppdVbMtRc8T8AHIbxuQi3g18DuKX1spyHkCE3JmofHUfJ0iCSHxhV4xVjG3iuqwn9bPs hk+K+sRhQjcntkIXfV3/6lnnDP2e4bRaLzM84XFH415GsikyD4lyPl/4wHxvSTMG5y0o gWzmC3sK7F4kJ7exyeApZR/P3J8jz1DSufkbaIzVeG/nvfs3gRmLMVucjGWsLl0mZjTY 82jQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m27si3903083edj.431.2020.07.01.02.10.28; Wed, 01 Jul 2020 02:10:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729497AbgGAJJs (ORCPT + 99 others); Wed, 1 Jul 2020 05:09:48 -0400 Received: from foss.arm.com ([217.140.110.172]:47876 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729471AbgGAJJo (ORCPT ); Wed, 1 Jul 2020 05:09:44 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C5002139F; Wed, 1 Jul 2020 02:09:43 -0700 (PDT) Received: from e108754-lin.cambridge.arm.com (unknown [10.1.198.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0CA303F68F; Wed, 1 Jul 2020 02:09:41 -0700 (PDT) From: Ionela Voinescu To: rjw@rjwysocki.net, viresh.kumar@linaro.org, catalin.marinas@arm.com, sudeep.holla@arm.com, will@kernel.org, linux@armlinux.org.uk, valentin.schneider@arm.com Cc: mingo@redhat.com, peterz@infradead.org, dietmar.eggemann@arm.com, ionela.voinescu@arm.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] arch_topology,cpufreq,sched/core: constify arch_* cpumasks Date: Wed, 1 Jul 2020 10:07:49 +0100 Message-Id: <20200701090751.7543-7-ionela.voinescu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200701090751.7543-1-ionela.voinescu@arm.com> References: <20200701090751.7543-1-ionela.voinescu@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Valentin Schneider The passed cpumask arguments to: - arch_set_freq_scale(), - arch_set_thermal_pressure(), and - arch_freq_counters_available() are only iterated over, so reflect this in the prototype. This also allows to pass system cpumasks like cpu_online_mask without getting a warning. Signed-off-by: Valentin Schneider Signed-off-by: Ionela Voinescu Cc: Catalin Marinas Cc: Will Deacon Cc: Sudeep Holla Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: Ingo Molnar Cc: Peter Zijlstra --- arch/arm64/kernel/topology.c | 2 +- drivers/base/arch_topology.c | 4 ++-- drivers/cpufreq/cpufreq.c | 5 +++-- include/linux/arch_topology.h | 4 ++-- include/linux/cpufreq.h | 3 ++- kernel/sched/core.c | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 0801a0f3c156..9a9f2b8dedf5 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -253,7 +253,7 @@ static int __init init_amu_fie(void) } late_initcall_sync(init_amu_fie); -bool arch_freq_counters_available(struct cpumask *cpus) +bool arch_freq_counters_available(const struct cpumask *cpus) { return amu_freq_invariant() && cpumask_subset(cpus, amu_fie_cpus); diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 4d0a0038b476..8447e1f30340 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -21,13 +21,13 @@ #include #include -__weak bool arch_freq_counters_available(struct cpumask *cpus) +__weak bool arch_freq_counters_available(const struct cpumask *cpus) { return false; } DEFINE_PER_CPU(unsigned long, freq_scale) = SCHED_CAPACITY_SCALE; -void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, +void arch_set_freq_scale(const struct cpumask *cpus, unsigned long cur_freq, unsigned long max_freq) { unsigned long scale; diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 60b5272c5d80..161b8089b0f6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -177,8 +177,9 @@ u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy) } EXPORT_SYMBOL_GPL(get_cpu_idle_time); -__weak void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, - unsigned long max_freq) +__weak void arch_set_freq_scale(const struct cpumask *cpus, + unsigned long cur_freq, + unsigned long max_freq) { } EXPORT_SYMBOL_GPL(arch_set_freq_scale); diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index 0566cb3314ef..4be0315700cb 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -30,7 +30,7 @@ static inline unsigned long topology_get_freq_scale(int cpu) return per_cpu(freq_scale, cpu); } -bool arch_freq_counters_available(struct cpumask *cpus); +bool arch_freq_counters_available(const struct cpumask *cpus); DECLARE_PER_CPU(unsigned long, thermal_pressure); @@ -39,7 +39,7 @@ static inline unsigned long topology_get_thermal_pressure(int cpu) return per_cpu(thermal_pressure, cpu); } -void arch_set_thermal_pressure(struct cpumask *cpus, +void arch_set_thermal_pressure(const struct cpumask *cpus, unsigned long th_pressure); struct cpu_topology { diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 8b6369d657bd..23398133c24b 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -1003,7 +1003,8 @@ static inline void sched_cpufreq_governor_change(struct cpufreq_policy *policy, extern void arch_freq_prepare_all(void); extern unsigned int arch_freq_get_on_cpu(int cpu); -extern void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, +extern void arch_set_freq_scale(const struct cpumask *cpus, + unsigned long cur_freq, unsigned long max_freq); /* the following are really really optional */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f518af52d0fb..b44a42b1236c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3645,7 +3645,7 @@ unsigned long long task_sched_runtime(struct task_struct *p) DEFINE_PER_CPU(unsigned long, thermal_pressure); -void arch_set_thermal_pressure(struct cpumask *cpus, +void arch_set_thermal_pressure(const struct cpumask *cpus, unsigned long th_pressure) { int cpu; -- 2.17.1