summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_ondemand.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-02-15 02:21:35 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-09 14:41:05 +0100
commit6e96c5b3ac5181d4b787590e54c4af99d3fa5f2e (patch)
tree4065db3ec3a26bc6230bb35a570b6d330afe97ae /drivers/cpufreq/cpufreq_ondemand.c
parent57dc3bcd454eb420ddf25d89852993b61b351327 (diff)
downloadlinux-stable-6e96c5b3ac5181d4b787590e54c4af99d3fa5f2e.tar.gz
linux-stable-6e96c5b3ac5181d4b787590e54c4af99d3fa5f2e.tar.bz2
linux-stable-6e96c5b3ac5181d4b787590e54c4af99d3fa5f2e.zip
cpufreq: ondemand: Simplify conditionals in od_dbs_timer()
Reduce the indentation level in the conditionals in od_dbs_timer() and drop the delay variable from it. No functional changes. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 812d9949a0c4..cb5a097c19ea 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -194,7 +194,7 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy)
struct policy_dbs_info *policy_dbs = policy->governor_data;
struct dbs_data *dbs_data = policy_dbs->dbs_data;
struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, policy->cpu);
- int delay, sample_type = dbs_info->sample_type;
+ int sample_type = dbs_info->sample_type;
/* Common NORMAL_SAMPLE setup */
dbs_info->sample_type = OD_NORMAL_SAMPLE;
@@ -203,22 +203,20 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy)
* it then.
*/
if (sample_type == OD_SUB_SAMPLE && policy_dbs->sample_delay_ns > 0) {
- delay = dbs_info->freq_lo_jiffies;
__cpufreq_driver_target(policy, dbs_info->freq_lo,
CPUFREQ_RELATION_H);
- } else {
- od_update(policy);
- if (dbs_info->freq_lo) {
- /* Setup timer for SUB_SAMPLE */
- dbs_info->sample_type = OD_SUB_SAMPLE;
- delay = dbs_info->freq_hi_jiffies;
- } else {
- delay = delay_for_sampling_rate(dbs_data->sampling_rate
- * policy_dbs->rate_mult);
- }
+ return dbs_info->freq_lo_jiffies;
+ }
+
+ od_update(policy);
+
+ if (dbs_info->freq_lo) {
+ /* Setup timer for SUB_SAMPLE */
+ dbs_info->sample_type = OD_SUB_SAMPLE;
+ return dbs_info->freq_hi_jiffies;
}
- return delay;
+ return delay_for_sampling_rate(dbs_data->sampling_rate * policy_dbs->rate_mult);
}
/************************** sysfs interface ************************/