From: Huang, Tao Date: Wed, 12 Jul 2017 13:03:19 +0000 (+0800) Subject: sched/fair: fix building without CGROUP_SCHEDTUNE X-Git-Tag: release-20171130_firefly~4^2~227 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0dc92faf3e93d11203bd3a50d12061456d76dc1a;p=firefly-linux-kernel-4.4.55.git sched/fair: fix building without CGROUP_SCHEDTUNE Fixes: e00ebdcb8a7c ("sched/tune: don't use schedtune before it is ready") Change-Id: I86312b6d271365cfb94e6ca570771a6bca46e67b Signed-off-by: Huang, Tao --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 78b9586ae51c..84c0d8084dc5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5597,7 +5597,9 @@ 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 /* * System energy normalization * Returns the normalized value, in the range [0..SCHED_CAPACITY_SCALE], @@ -5608,9 +5610,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 #ifdef CONFIG_SCHED_DEBUG {