Commit ecddc3a0 authored by Valentin Schneider's avatar Valentin Schneider Committed by Rafael J. Wysocki

arch_topology, cpufreq: constify arch_* cpumasks

The passed cpumask arguments to arch_set_freq_scale() 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: default avatarValentin Schneider <valentin.schneider@arm.com>
Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 874f6353
...@@ -253,7 +253,7 @@ static int __init init_amu_fie(void) ...@@ -253,7 +253,7 @@ static int __init init_amu_fie(void)
} }
late_initcall_sync(init_amu_fie); 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() && return amu_freq_invariant() &&
cpumask_subset(cpus, amu_fie_cpus); cpumask_subset(cpus, amu_fie_cpus);
......
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/smp.h> #include <linux/smp.h>
__weak bool arch_freq_counters_available(struct cpumask *cpus) __weak bool arch_freq_counters_available(const struct cpumask *cpus)
{ {
return false; return false;
} }
DEFINE_PER_CPU(unsigned long, freq_scale) = SCHED_CAPACITY_SCALE; 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 max_freq)
{ {
unsigned long scale; unsigned long scale;
......
...@@ -160,7 +160,8 @@ u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy) ...@@ -160,7 +160,8 @@ u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy)
} }
EXPORT_SYMBOL_GPL(get_cpu_idle_time); EXPORT_SYMBOL_GPL(get_cpu_idle_time);
__weak void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, __weak void arch_set_freq_scale(const struct cpumask *cpus,
unsigned long cur_freq,
unsigned long max_freq) unsigned long max_freq)
{ {
} }
......
...@@ -30,7 +30,7 @@ static inline unsigned long topology_get_freq_scale(int cpu) ...@@ -30,7 +30,7 @@ static inline unsigned long topology_get_freq_scale(int cpu)
return per_cpu(freq_scale, 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); DECLARE_PER_CPU(unsigned long, thermal_pressure);
......
...@@ -1011,7 +1011,8 @@ static inline void sched_cpufreq_governor_change(struct cpufreq_policy *policy, ...@@ -1011,7 +1011,8 @@ static inline void sched_cpufreq_governor_change(struct cpufreq_policy *policy,
extern void arch_freq_prepare_all(void); extern void arch_freq_prepare_all(void);
extern unsigned int arch_freq_get_on_cpu(int cpu); 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); unsigned long max_freq);
/* the following are really really optional */ /* the following are really really optional */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment