Commit a23d6d18 authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki

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: default avatarViresh Kumar <viresh.kumar@linaro.org>
[ rjw: Changelog ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent aded387b
...@@ -194,7 +194,7 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy) ...@@ -194,7 +194,7 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy)
struct policy_dbs_info *policy_dbs = policy->governor_data; struct policy_dbs_info *policy_dbs = policy->governor_data;
struct dbs_data *dbs_data = policy_dbs->dbs_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); 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 */ /* Common NORMAL_SAMPLE setup */
dbs_info->sample_type = OD_NORMAL_SAMPLE; dbs_info->sample_type = OD_NORMAL_SAMPLE;
...@@ -208,13 +208,12 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy) ...@@ -208,13 +208,12 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy)
/* Setup timer for SUB_SAMPLE */ /* Setup timer for SUB_SAMPLE */
dbs_info->sample_type = OD_SUB_SAMPLE; dbs_info->sample_type = OD_SUB_SAMPLE;
delay = dbs_info->freq_hi_jiffies; 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; return delay;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment