aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authortravis@sgi.com <travis@sgi.com>2008-01-30 07:33:11 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:11 -0500
commit2c6b8c030cfca334c3d700ee504036c585c4c6a3 (patch)
tree58bdf22bf4ebd6c7918bfa9713717eae83838251 /arch/x86/kernel/cpu
parent3cc87e3f4042a099fb649c5df33d3ccfae36173f (diff)
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: Mike Travis <travis@sgi.com> Reviewed-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 99e1ef9939be..a0522735dd9d 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -52,7 +52,7 @@
52/* serialize freq changes */ 52/* serialize freq changes */
53static DEFINE_MUTEX(fidvid_mutex); 53static DEFINE_MUTEX(fidvid_mutex);
54 54
55static struct powernow_k8_data *powernow_data[NR_CPUS]; 55static DEFINE_PER_CPU(struct powernow_k8_data *, powernow_data);
56 56
57static int cpu_family = CPU_OPTERON; 57static int cpu_family = CPU_OPTERON;
58 58
@@ -1018,7 +1018,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
1018static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) 1018static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation)
1019{ 1019{
1020 cpumask_t oldmask = CPU_MASK_ALL; 1020 cpumask_t oldmask = CPU_MASK_ALL;
1021 struct powernow_k8_data *data = powernow_data[pol->cpu]; 1021 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
1022 u32 checkfid; 1022 u32 checkfid;
1023 u32 checkvid; 1023 u32 checkvid;
1024 unsigned int newstate; 1024 unsigned int newstate;
@@ -1094,7 +1094,7 @@ err_out:
1094/* Driver entry point to verify the policy and range of frequencies */ 1094/* Driver entry point to verify the policy and range of frequencies */
1095static int powernowk8_verify(struct cpufreq_policy *pol) 1095static int powernowk8_verify(struct cpufreq_policy *pol)
1096{ 1096{
1097 struct powernow_k8_data *data = powernow_data[pol->cpu]; 1097 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
1098 1098
1099 if (!data) 1099 if (!data)
1100 return -EINVAL; 1100 return -EINVAL;
@@ -1202,7 +1202,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1202 dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n", 1202 dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n",
1203 data->currfid, data->currvid); 1203 data->currfid, data->currvid);
1204 1204
1205 powernow_data[pol->cpu] = data; 1205 per_cpu(powernow_data, pol->cpu) = data;
1206 1206
1207 return 0; 1207 return 0;
1208 1208
@@ -1216,7 +1216,7 @@ err_out:
1216 1216
1217static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol) 1217static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol)
1218{ 1218{
1219 struct powernow_k8_data *data = powernow_data[pol->cpu]; 1219 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
1220 1220
1221 if (!data) 1221 if (!data)
1222 return -EINVAL; 1222 return -EINVAL;
@@ -1237,7 +1237,7 @@ static unsigned int powernowk8_get (unsigned int cpu)
1237 cpumask_t oldmask = current->cpus_allowed; 1237 cpumask_t oldmask = current->cpus_allowed;
1238 unsigned int khz = 0; 1238 unsigned int khz = 0;
1239 1239
1240 data = powernow_data[first_cpu(per_cpu(cpu_core_map, cpu))]; 1240 data = per_cpu(powernow_data, first_cpu(per_cpu(cpu_core_map, cpu)));
1241 1241
1242 if (!data) 1242 if (!data)
1243 return -EINVAL; 1243 return -EINVAL;