Commit 90ac908a authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

cpufreq: schedutil: Simplify sugov_update_next_freq()



Rearrange a conditional to make it more straightforward.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 2554c32f
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -102,12 +102,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time,
				   unsigned int next_freq)
{
	if (!sg_policy->need_freq_update) {
		if (sg_policy->next_freq == next_freq)
			return false;
	} else {
	if (sg_policy->need_freq_update)
		sg_policy->need_freq_update = cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS);
	}
	else if (sg_policy->next_freq == next_freq)
		return false;

	sg_policy->next_freq = next_freq;
	sg_policy->last_freq_update_time = time;