Commit 2c6b8c03 authored by travis@sgi.com's avatar travis@sgi.com Committed by Ingo Molnar

x86: change NR_CPUS arrays in powernow-k8

Change the following static arrays sized by NR_CPUS to
per_cpu data variables:

	powernow_k8_data *powernow_data[NR_CPUS];
Signed-off-by: default avatarMike Travis <travis@sgi.com>
Reviewed-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 3cc87e3f
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
/* serialize freq changes */ /* serialize freq changes */
static DEFINE_MUTEX(fidvid_mutex); static DEFINE_MUTEX(fidvid_mutex);
static struct powernow_k8_data *powernow_data[NR_CPUS]; static DEFINE_PER_CPU(struct powernow_k8_data *, powernow_data);
static int cpu_family = CPU_OPTERON; static int cpu_family = CPU_OPTERON;
...@@ -1018,7 +1018,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i ...@@ -1018,7 +1018,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation)
{ {
cpumask_t oldmask = CPU_MASK_ALL; cpumask_t oldmask = CPU_MASK_ALL;
struct powernow_k8_data *data = powernow_data[pol->cpu]; struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
u32 checkfid; u32 checkfid;
u32 checkvid; u32 checkvid;
unsigned int newstate; unsigned int newstate;
...@@ -1094,7 +1094,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi ...@@ -1094,7 +1094,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
/* Driver entry point to verify the policy and range of frequencies */ /* Driver entry point to verify the policy and range of frequencies */
static int powernowk8_verify(struct cpufreq_policy *pol) static int powernowk8_verify(struct cpufreq_policy *pol)
{ {
struct powernow_k8_data *data = powernow_data[pol->cpu]; struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
if (!data) if (!data)
return -EINVAL; return -EINVAL;
...@@ -1202,7 +1202,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1202,7 +1202,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n", dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n",
data->currfid, data->currvid); data->currfid, data->currvid);
powernow_data[pol->cpu] = data; per_cpu(powernow_data, pol->cpu) = data;
return 0; return 0;
...@@ -1216,7 +1216,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1216,7 +1216,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol) static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol)
{ {
struct powernow_k8_data *data = powernow_data[pol->cpu]; struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
if (!data) if (!data)
return -EINVAL; return -EINVAL;
...@@ -1237,7 +1237,7 @@ static unsigned int powernowk8_get (unsigned int cpu) ...@@ -1237,7 +1237,7 @@ static unsigned int powernowk8_get (unsigned int cpu)
cpumask_t oldmask = current->cpus_allowed; cpumask_t oldmask = current->cpus_allowed;
unsigned int khz = 0; unsigned int khz = 0;
data = powernow_data[first_cpu(per_cpu(cpu_core_map, cpu))]; data = per_cpu(powernow_data, first_cpu(per_cpu(cpu_core_map, cpu)));
if (!data) if (!data)
return -EINVAL; return -EINVAL;
......
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