From: Rafael J. Wysocki Date: Thu, 12 Nov 2020 19:26:42 +0000 (+0100) Subject: cpufreq: schedutil: Simplify sugov_update_next_freq() X-Git-Tag: v5.11-rc1~151^2~3^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90ac908a418b836427d6eaf84fbc5062881747fd;p=thirdparty%2Fkernel%2Flinux.git cpufreq: schedutil: Simplify sugov_update_next_freq() Rearrange a conditional to make it more straightforward. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar --- diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 97d318b0cd0cb..77736058d8e4d 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -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;