summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/cpufreq_ondemand.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2016-02-11 17:31:16 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-09 14:41:02 +0100
commita23d6d180914dd91e320283c81e4f84f028e24f4 (patch)
treeef46e3c493e73f956c88df1cec9a7b750b4bc867 /drivers/cpufreq/cpufreq_ondemand.c
parentaded387b94b69aeab10e1d112bab7f82c9241527 (diff)
cpufreq: ondemand: Rearrange od_dbs_timer() to avoid updating delay
Avoid extra checks in od_dbs_timer() by rearranging updates to the local delay variable in it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 12213823cc93..0b79f1488be4 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 = 0, sample_type = dbs_info->sample_type;
+ int delay, sample_type = dbs_info->sample_type;
/* Common NORMAL_SAMPLE setup */
dbs_info->sample_type = OD_NORMAL_SAMPLE;
@@ -208,13 +208,12 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy)
/* 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
+ * dbs_info->rate_mult);
}
}
- if (!delay)
- delay = delay_for_sampling_rate(dbs_data->sampling_rate
- * dbs_info->rate_mult);
-
return delay;
}