cpufreq: intel_pstate: Rearrange show_no_turbo() and store_no_turbo()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 25 Mar 2024 17:03:25 +0000 (18:03 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 2 Apr 2024 10:57:04 +0000 (12:57 +0200)
commitc626a438452079824139f97137f17af47b1a8989
tree621dc1d2ca239b2c59b326f8ec71614f86f39b49
parent0940f1a8011fd69be5082015068e0dc31c800c20
cpufreq: intel_pstate: Rearrange show_no_turbo() and store_no_turbo()

Now that global.turbo_disabled can only change at the cpufreq driver
registration time, initialize global.no_turbo at that time too so they
are in sync to start with (if the former is set, the latter cannot be
updated later anyway).

That allows show_no_turbo() to be simlified because it does not need
to check global.turbo_disabled and store_no_turbo() can be rearranged
to avoid doing anything if the new value of global.no_turbo is equal
to the current one and only return an error on attempts to clear
global.no_turbo when global.turbo_disabled.

While at it, eliminate the redundant ret variable from store_no_turbo().

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
drivers/cpufreq/intel_pstate.c