Commit 51a5790
cpufreq: intel_pstate: Rearrange show_no_turbo() and store_no_turbo()
[ Upstream commit c626a43 ]
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>
Stable-dep-of: 350cbb5 ("cpufreq: intel_pstate: Check turbo_is_disabled() in store_no_turbo()")
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 4907546 commit 51a5790
1 file changed
Lines changed: 18 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1230 | 1230 | | |
1231 | 1231 | | |
1232 | 1232 | | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
| 1233 | + | |
1237 | 1234 | | |
1238 | 1235 | | |
1239 | 1236 | | |
| |||
1244 | 1241 | | |
1245 | 1242 | | |
1246 | 1243 | | |
1247 | | - | |
| 1244 | + | |
1248 | 1245 | | |
1249 | | - | |
1250 | | - | |
| 1246 | + | |
1251 | 1247 | | |
1252 | 1248 | | |
1253 | 1249 | | |
1254 | 1250 | | |
1255 | 1251 | | |
1256 | | - | |
1257 | | - | |
| 1252 | + | |
| 1253 | + | |
1258 | 1254 | | |
1259 | 1255 | | |
1260 | | - | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
1261 | 1260 | | |
1262 | 1261 | | |
1263 | 1262 | | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
| 1263 | + | |
| 1264 | + | |
1267 | 1265 | | |
1268 | 1266 | | |
1269 | | - | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
1270 | 1270 | | |
1271 | | - | |
| 1271 | + | |
1272 | 1272 | | |
1273 | 1273 | | |
1274 | 1274 | | |
| |||
1280 | 1280 | | |
1281 | 1281 | | |
1282 | 1282 | | |
1283 | | - | |
| 1283 | + | |
1284 | 1284 | | |
| 1285 | + | |
1285 | 1286 | | |
1286 | 1287 | | |
1287 | 1288 | | |
| |||
3078 | 3079 | | |
3079 | 3080 | | |
3080 | 3081 | | |
| 3082 | + | |
3081 | 3083 | | |
3082 | 3084 | | |
3083 | 3085 | | |
| |||
0 commit comments