Skip to content

Commit

Permalink
cpufreq: schedutil: Simplify sugov_fast_switch()
Browse files Browse the repository at this point in the history
Drop a redundant local variable definition from sugov_fast_switch()
and rearrange the code in there to avoid the redundant logical
negation.

Signed-off-by: Rafael J. Wysocki <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
  • Loading branch information
rafaeljw committed Oct 7, 2020
1 parent a17a733 commit 86836ba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kernel/sched/cpufreq_schedutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,8 @@ static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time,
static void sugov_fast_switch(struct sugov_policy *sg_policy, u64 time,
unsigned int next_freq)
{
struct cpufreq_policy *policy = sg_policy->policy;

if (!sugov_update_next_freq(sg_policy, time, next_freq))
return;

cpufreq_driver_fast_switch(policy, next_freq);
if (sugov_update_next_freq(sg_policy, time, next_freq))
cpufreq_driver_fast_switch(sg_policy->policy, next_freq);
}

static void sugov_deferred_update(struct sugov_policy *sg_policy, u64 time,
Expand Down

0 comments on commit 86836ba

Please sign in to comment.