]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cpufreq: Consolidate some code in cpufreq_online()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 28 Mar 2025 20:40:43 +0000 (21:40 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 9 Apr 2025 19:18:50 +0000 (21:18 +0200)
commit387b51709db546033cf9a940860b6614a5cda5b6
tree285496c89af3235b1020cd1244d6c3583248abbd
parent0af2f6be1b4281385b618cb86ad946eded089ac8
cpufreq: Consolidate some code in cpufreq_online()

Notice that the policy->cpu update in cpufreq_policy_alloc() can be
moved to cpufreq_online() and then it can be carried out under the
policy rwsem, along with the clearing of policy->governor (unnecessary
in the "new policy" code branch, but also not harmful).  If this is
done, the bottom parts of the "if (policy)" branches become identical
and they can be collapsed and moved below the conditional.

Modify the code accordingly which makes it somewhat easier to follow.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://patch.msgid.link/13741234.uLZWGnKmhe@rjwysocki.net
drivers/cpufreq/cpufreq.c