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

Commit 2fbeb27a authored by Junjie Wu's avatar Junjie Wu Committed by Matt Wagantall
Browse files

cpufreq: interactive: Fix compiler warning for hvt



Compiler warns about hvt variable in
cpufreq_interactive_speedchange_task() being used without
initialization. Initialize it to ~0ULL.

Note that in reality, this won't happen because when governor_enabled
is true, these two conditions are guaranteed:
1) policy->cpus won't be empty, and
2) target_freq won't be 0.
Otherwise, it indicates more serious issues in the system.

With these two conditions, hvt will be overwritten by at least
one CPU's local_hvttime.

Change-Id: I4378393ed811674f25d54852c296ee5ff407e7e3
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent 62575c26
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -667,7 +667,7 @@ static int cpufreq_interactive_speedchange_task(void *data)
			unsigned int j;
			unsigned int max_freq = 0;
			struct cpufreq_interactive_cpuinfo *pjcpu;
			u64 hvt;
			u64 hvt = ~0ULL;

			pcpu = &per_cpu(cpuinfo, cpu);
			if (!down_read_trylock(&pcpu->enable_sem))