提交 f068c04b 编写于 作者: D Dave Jones

[CPUFREQ] Fix -Wshadow warning in conservative governor.

drivers/cpufreq/cpufreq_conservative.c:336:15: warning: symbol 'freq_step' shadows an earlier one

Just rename the local variable.
Signed-off-by: NDave Jones <davej@redhat.com>
上级 ec983f70
...@@ -333,7 +333,7 @@ static void dbs_check_cpu(int cpu) ...@@ -333,7 +333,7 @@ static void dbs_check_cpu(int cpu)
{ {
unsigned int idle_ticks, up_idle_ticks, down_idle_ticks; unsigned int idle_ticks, up_idle_ticks, down_idle_ticks;
unsigned int tmp_idle_ticks, total_idle_ticks; unsigned int tmp_idle_ticks, total_idle_ticks;
unsigned int freq_step; unsigned int freq_target;
unsigned int freq_down_sampling_rate; unsigned int freq_down_sampling_rate;
struct cpu_dbs_info_s *this_dbs_info = &per_cpu(cpu_dbs_info, cpu); struct cpu_dbs_info_s *this_dbs_info = &per_cpu(cpu_dbs_info, cpu);
struct cpufreq_policy *policy; struct cpufreq_policy *policy;
...@@ -383,13 +383,13 @@ static void dbs_check_cpu(int cpu) ...@@ -383,13 +383,13 @@ static void dbs_check_cpu(int cpu)
if (this_dbs_info->requested_freq == policy->max) if (this_dbs_info->requested_freq == policy->max)
return; return;
freq_step = (dbs_tuners_ins.freq_step * policy->max) / 100; freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100;
/* max freq cannot be less than 100. But who knows.... */ /* max freq cannot be less than 100. But who knows.... */
if (unlikely(freq_step == 0)) if (unlikely(freq_target == 0))
freq_step = 5; freq_target = 5;
this_dbs_info->requested_freq += freq_step; this_dbs_info->requested_freq += freq_target;
if (this_dbs_info->requested_freq > policy->max) if (this_dbs_info->requested_freq > policy->max)
this_dbs_info->requested_freq = policy->max; this_dbs_info->requested_freq = policy->max;
...@@ -425,19 +425,19 @@ static void dbs_check_cpu(int cpu) ...@@ -425,19 +425,19 @@ static void dbs_check_cpu(int cpu)
/* /*
* if we are already at the lowest speed then break out early * if we are already at the lowest speed then break out early
* or if we 'cannot' reduce the speed as the user might want * or if we 'cannot' reduce the speed as the user might want
* freq_step to be zero * freq_target to be zero
*/ */
if (this_dbs_info->requested_freq == policy->min if (this_dbs_info->requested_freq == policy->min
|| dbs_tuners_ins.freq_step == 0) || dbs_tuners_ins.freq_step == 0)
return; return;
freq_step = (dbs_tuners_ins.freq_step * policy->max) / 100; freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100;
/* max freq cannot be less than 100. But who knows.... */ /* max freq cannot be less than 100. But who knows.... */
if (unlikely(freq_step == 0)) if (unlikely(freq_target == 0))
freq_step = 5; freq_target = 5;
this_dbs_info->requested_freq -= freq_step; this_dbs_info->requested_freq -= freq_target;
if (this_dbs_info->requested_freq < policy->min) if (this_dbs_info->requested_freq < policy->min)
this_dbs_info->requested_freq = policy->min; this_dbs_info->requested_freq = policy->min;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册