mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
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>
This commit is contained in:
parent
ab4dd38143
commit
b3501ab084
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user