Skip to content

Commit 78d83b2

Browse files
Lifeng Zhengrafaeljw
authored andcommitted
cpufreq: cpufreq_boost_trigger_state() optimization
Optimize the error handling code in cpufreq_boost_trigger_state(). Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Jie Zhan <zhanjie9@hisilicon.com> [ rjw: Changelog edit ] Link: https://patch.msgid.link/20251202072727.1368285-3-zhenglifeng1@huawei.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 77cf053 commit 78d83b2

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

drivers/cpufreq/cpufreq.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,19 +2820,14 @@ static int cpufreq_boost_trigger_state(int state)
28202820
continue;
28212821

28222822
ret = policy_set_boost(policy, state);
2823-
if (ret)
2824-
goto err_reset_state;
2823+
if (unlikely(ret))
2824+
break;
28252825
}
28262826

2827-
if (ret)
2828-
goto err_reset_state;
2829-
28302827
cpus_read_unlock();
28312828

2832-
return 0;
2833-
2834-
err_reset_state:
2835-
cpus_read_unlock();
2829+
if (likely(!ret))
2830+
return 0;
28362831

28372832
write_lock_irqsave(&cpufreq_driver_lock, flags);
28382833
cpufreq_driver->boost_enabled = !state;

0 commit comments

Comments
 (0)