summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorRuss Weight <russell.h.weight@intel.com>2017-06-08 11:38:59 -0700
committerChris Redpath <chris.redpath@arm.com>2017-10-27 13:30:34 +0100
commite3ba92c160d3fb21af5b28a21c63851fad21b168 (patch)
tree4e4012cd50d29429ce89c3f27825d2721a54830c /kernel
parent3c71cbb896fe15de4f365223af45096c4098c309 (diff)
sched/tune: access schedtune_initialized under CGROUP_SCHEDTUNE
schedtune_initialized is protected by CONFIG_CGROUP_SCHEDTUNE, but is being used without CONFIG_CGROUP_SCHEDTUNE being defined. Add appropriate ifdefs around the usage of schedtune_initialized to avoid a compilation error when CONFIG_CGROUP_SCHEDTUNE is not defined. Change-Id: Iab79bf053d74db3eeb84c09d71d43b4e39746ed2 Signed-off-by: Russ Weight <russell.h.weight@intel.com> Signed-off-by: Fei Yang <fei.yang@intel.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e9919aeacdd5..6023d9e3a9f5 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5668,7 +5668,11 @@ static inline int __energy_diff(struct energy_env *eenv)
#ifdef CONFIG_SCHED_TUNE
struct target_nrg schedtune_target_nrg;
+
+#ifdef CONFIG_CGROUP_SCHEDTUNE
extern bool schedtune_initialized;
+#endif /* CONFIG_CGROUP_SCHEDTUNE */
+
/*
* System energy normalization
* Returns the normalized value, in the range [0..SCHED_CAPACITY_SCALE],
@@ -5679,9 +5683,11 @@ normalize_energy(int energy_diff)
{
u32 normalized_nrg;
+#ifdef CONFIG_CGROUP_SCHEDTUNE
/* during early setup, we don't know the extents */
if (unlikely(!schedtune_initialized))
return energy_diff < 0 ? -1 : 1 ;
+#endif /* CONFIG_CGROUP_SCHEDTUNE */
#ifdef CONFIG_SCHED_DEBUG
{