cpufreq: rename index as driver_data in cpufreq_frequency_table
The "index" field of struct cpufreq_frequency_table was never an index and isn't used at all by the cpufreq core. It only is useful for cpufreq drivers for their internal purposes. Many people nowadays blindly set it in ascending order with the assumption that the core will use it, which is a mistake. Rename it to "driver_data" as that's what its purpose is. All of its users are updated accordingly. [rjw: Changelog] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:

committed by
Rafael J. Wysocki

szülő
2361be2366
commit
5070158804
@@ -79,11 +79,11 @@ static struct cpufreq_driver centrino_driver;
|
||||
|
||||
/* Computes the correct form for IA32_PERF_CTL MSR for a particular
|
||||
frequency/voltage operating point; frequency in MHz, volts in mV.
|
||||
This is stored as "index" in the structure. */
|
||||
This is stored as "driver_data" in the structure. */
|
||||
#define OP(mhz, mv) \
|
||||
{ \
|
||||
.frequency = (mhz) * 1000, \
|
||||
.index = (((mhz)/100) << 8) | ((mv - 700) / 16) \
|
||||
.driver_data = (((mhz)/100) << 8) | ((mv - 700) / 16) \
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -307,7 +307,7 @@ static unsigned extract_clock(unsigned msr, unsigned int cpu, int failsafe)
|
||||
per_cpu(centrino_model, cpu)->op_points[i].frequency
|
||||
!= CPUFREQ_TABLE_END;
|
||||
i++) {
|
||||
if (msr == per_cpu(centrino_model, cpu)->op_points[i].index)
|
||||
if (msr == per_cpu(centrino_model, cpu)->op_points[i].driver_data)
|
||||
return per_cpu(centrino_model, cpu)->
|
||||
op_points[i].frequency;
|
||||
}
|
||||
@@ -501,7 +501,7 @@ static int centrino_target (struct cpufreq_policy *policy,
|
||||
break;
|
||||
}
|
||||
|
||||
msr = per_cpu(centrino_model, cpu)->op_points[newstate].index;
|
||||
msr = per_cpu(centrino_model, cpu)->op_points[newstate].driver_data;
|
||||
|
||||
if (first_cpu) {
|
||||
rdmsr_on_cpu(good_cpu, MSR_IA32_PERF_CTL, &oldmsr, &h);
|
||||
|
Reference in New Issue
Block a user