From: "Mark Langsdorf" Subject: [cpufreq][PATCH] minor clean-ups for ondemand governor Date: Fri, 2 Nov 2007 16:28:53 -0500 Message-ID: <200711021628.54072.mark.langsdorf@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com, osrc-patches@elbe.amd.com List-Id: xen-devel@lists.xenproject.org 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 -r d827dfc6593e drivers/cpufreq/cpufreq_ondemand.c --- a/drivers/cpufreq/cpufreq_ondemand.c Thu Nov 01 09:07:45 2007 -0600 +++ b/drivers/cpufreq/cpufreq_ondemand.c Fri Nov 02 16:41:49 2007 -0500 @@ -96,6 +96,7 @@ static inline cputime64_t get_cpu_idle_t 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_ 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;