[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hgP3PKLqiHsw9bADvxRGsBqQ__DVVKzEmgb6stTmi+cQ@mail.gmail.com>
Date: Mon, 23 Jun 2025 17:31:52 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Lifeng Zheng <zhenglifeng1@...wei.com>
Cc: rafael@...nel.org, viresh.kumar@...aro.org, ionela.voinescu@....com,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org, linuxarm@...wei.com,
jonathan.cameron@...wei.com, zhanjie9@...ilicon.com, lihuisong@...wei.com,
yubowen8@...wei.com
Subject: Re: [PATCH 4/7] cpufreq: Remove duplicate check in __cpufreq_offline()
On Mon, Jun 23, 2025 at 3:34 PM Lifeng Zheng <zhenglifeng1@...wei.com> wrote:
>
> The has_target() checks in __cpufreq_offline() are duplicate. Remove one of
> them and put the operations of exiting governor together with storing last
> governor's name.
>
> Signed-off-by: Lifeng Zheng <zhenglifeng1@...wei.com>
> ---
> drivers/cpufreq/cpufreq.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 2303890de0ba..c4891bf5dc84 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1692,14 +1692,13 @@ static void __cpufreq_offline(unsigned int cpu, struct cpufreq_policy *policy)
> return;
> }
>
> - if (has_target())
> + if (has_target()) {
> strscpy(policy->last_governor, policy->governor->name,
> CPUFREQ_NAME_LEN);
> - else
> - policy->last_policy = policy->policy;
> -
> - if (has_target())
> cpufreq_exit_governor(policy);
> + } else {
> + policy->last_policy = policy->policy;
> + }
>
> /*
> * Perform the ->offline() during light-weight tear-down, as
> --
This is fine by me, thanks!
Powered by blists - more mailing lists