mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 21:53:44 +00:00
PM / EM: Declare EM data types unconditionally
The structs representing capacity states and performance domains of an Energy Model are currently only defined for CONFIG_ENERGY_MODEL=y. That makes it hard for code outside PM_EM to manipulate those structures without a lot of ifdefery or stubbed accessors. So, move the declaration of the two structs outside of the CONFIG_ENERGY_MODEL ifdef. The client code (e.g. EAS or thermal) always checks the return of em_cpu_get() before using it, so the exising code is still safe to use as-is. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Quentin Perret <qperret@google.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20191030151451.7961-3-qperret@google.com
This commit is contained in:
parent
48da6f8005
commit
27a47e422e
@ -9,7 +9,6 @@
|
|||||||
#include <linux/sched/topology.h>
|
#include <linux/sched/topology.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
#ifdef CONFIG_ENERGY_MODEL
|
|
||||||
/**
|
/**
|
||||||
* em_cap_state - Capacity state of a performance domain
|
* em_cap_state - Capacity state of a performance domain
|
||||||
* @frequency: The CPU frequency in KHz, for consistency with CPUFreq
|
* @frequency: The CPU frequency in KHz, for consistency with CPUFreq
|
||||||
@ -40,6 +39,7 @@ struct em_perf_domain {
|
|||||||
unsigned long cpus[0];
|
unsigned long cpus[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENERGY_MODEL
|
||||||
#define EM_CPU_MAX_POWER 0xFFFF
|
#define EM_CPU_MAX_POWER 0xFFFF
|
||||||
|
|
||||||
struct em_data_callback {
|
struct em_data_callback {
|
||||||
@ -160,7 +160,6 @@ static inline int em_pd_nr_cap_states(struct em_perf_domain *pd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
struct em_perf_domain {};
|
|
||||||
struct em_data_callback {};
|
struct em_data_callback {};
|
||||||
#define EM_DATA_CB(_active_power_cb) { }
|
#define EM_DATA_CB(_active_power_cb) { }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user