From: Keir Fraser Date: Mon, 5 Nov 2007 10:40:31 +0000 (+0000) Subject: cpufreq: minor clean-ups for ondemand governor on Xen. X-Git-Tag: xen-3.2.0~21^2^2~28^2^2~22^2^2~9^2~9 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4054d46ffa53610a88ca66b1067822214e1fcd2b;p=xenclient%2Fkernel.git cpufreq: minor clean-ups for ondemand governor on Xen. The cpufreq ondemand governor patch for Xen included some out of order code and some test code; re-order the code to assign a variable before passing it to a function and remove the test code. Signed-off-by: Mark Langsdorf --- diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index a1ca3cb2..b08b9556 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -96,6 +96,7 @@ static inline cputime64_t get_cpu_idle_time(unsigned int cpu) return retval; } + /************************** sysfs interface ************************/ static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) { @@ -281,15 +282,16 @@ static int dbs_calc_load(struct cpu_dbs_info_s *this_dbs_info) unsigned int j; cpumask_t cpumap; + policy = this_dbs_info->cur_policy; + cpumap = policy->cpus; + op.cmd = XENPF_getidletime; set_xen_guest_handle(op.u.getidletime.cpumap_bitmap, (uint8_t *) cpus_addr(cpumap)); - op.u.getidletime.cpumap_nr_cpus = NR_CPUS;// num_online_cpus(); + op.u.getidletime.cpumap_nr_cpus = NR_CPUS; set_xen_guest_handle(op.u.getidletime.idletime, idletime); if (HYPERVISOR_platform_op(&op)) return 200; - policy = this_dbs_info->cur_policy; - cpumap = policy->cpus; for_each_cpu_mask(j, cpumap) { cputime64_t total_idle_nsecs, tmp_idle_nsecs; cputime64_t total_wall_nsecs, tmp_wall_nsecs;