int cpufreq_limit_change(unsigned int cpu)
{
- struct processor_performance *perf = &processor_pminfo[cpu]->perf;
+ struct processor_performance *perf;
struct cpufreq_policy *data;
struct cpufreq_policy policy;
!processor_pminfo[cpu])
return -ENODEV;
+ perf = &processor_pminfo[cpu]->perf;
+
if (perf->platform_limit >= perf->state_count)
return -EINVAL;
struct cpufreq_dom *cpufreq_dom = NULL;
struct cpufreq_policy new_policy;
struct cpufreq_policy *policy;
- struct processor_performance *perf = &processor_pminfo[cpu]->perf;
+ struct processor_performance *perf;
/* to protect the case when Px was not controlled by xen */
- if (!processor_pminfo[cpu] ||
- !(perf->init & XEN_PX_INIT) ||
- !cpu_online(cpu))
+ if ( !processor_pminfo[cpu] || !cpu_online(cpu) )
+ return -EINVAL;
+
+ perf = &processor_pminfo[cpu]->perf;
+
+ if ( !(perf->init & XEN_PX_INIT) )
return -EINVAL;
if (!cpufreq_driver)
struct list_head *pos;
struct cpufreq_dom *cpufreq_dom = NULL;
struct cpufreq_policy *policy;
- struct processor_performance *perf = &processor_pminfo[cpu]->perf;
+ struct processor_performance *perf;
/* to protect the case when Px was not controlled by xen */
- if (!processor_pminfo[cpu] ||
- !(perf->init & XEN_PX_INIT) ||
- !cpu_online(cpu))
+ if ( !processor_pminfo[cpu] || !cpu_online(cpu) )
+ return -EINVAL;
+
+ perf = &processor_pminfo[cpu]->perf;
+
+ if ( !(perf->init & XEN_PX_INIT) )
return -EINVAL;
if (!per_cpu(cpufreq_cpu_policy, cpu))
static int __init cpufreq_presmp_init(void)
{
- void *cpu = (void *)(long)smp_processor_id();
- cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
register_cpu_notifier(&cpu_nfb);
return 0;
}