Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3ba92c1 authored by Russ Weight's avatar Russ Weight Committed by Chris Redpath
Browse files

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: default avatarRuss Weight <russell.h.weight@intel.com>
Signed-off-by: default avatarFei Yang <fei.yang@intel.com>
parent 3c71cbb8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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
	{