Skip to content

Commit 5d6ecaa

Browse files
Lifeng Zhengrafaeljw
authored andcommitted
cpufreq: Remove duplicate check in __cpufreq_offline()
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@huawei.com> Link: https://patch.msgid.link/20250623133402.3120230-5-zhenglifeng1@huawei.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 2e554cf commit 5d6ecaa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,14 +1691,13 @@ static void __cpufreq_offline(unsigned int cpu, struct cpufreq_policy *policy)
16911691
return;
16921692
}
16931693

1694-
if (has_target())
1694+
if (has_target()) {
16951695
strscpy(policy->last_governor, policy->governor->name,
16961696
CPUFREQ_NAME_LEN);
1697-
else
1698-
policy->last_policy = policy->policy;
1699-
1700-
if (has_target())
17011697
cpufreq_exit_governor(policy);
1698+
} else {
1699+
policy->last_policy = policy->policy;
1700+
}
17021701

17031702
/*
17041703
* Perform the ->offline() during light-weight tear-down, as

0 commit comments

Comments
 (0)