Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 21 Dec 2002 15:16:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 21 Dec 2002 15:16:30 -0500 Received: from natsmtp01.webmailer.de ([192.67.198.81]:61611 "EHLO post.webmailer.de") by vger.kernel.org with ESMTP id ; Sat, 21 Dec 2002 15:16:28 -0500 Date: Sat, 21 Dec 2002 21:25:09 +0100 From: Dominik Brodowski To: torvalds@transmeta.com Cc: linux-kernel@vger.kernel.org, cpufreq@www.linux.org.uk Subject: [PATCH 2.5] cpufreq: minor cleanups Message-ID: <20021221202509.GA2503@brodo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3222 Lines: 112 Get rid of CPUFREQ_ALL_CPUS codepaths not used anymore. Dominik diff -ruN linux-original/kernel/cpufreq.c linux/kernel/cpufreq.c --- linux-original/kernel/cpufreq.c 2002-12-21 21:21:57.000000000 +0100 +++ linux/kernel/cpufreq.c 2002-12-21 21:21:46.000000000 +0100 @@ -365,7 +365,7 @@ { struct cpufreq_policy policy; down(&cpufreq_driver_sem); - if (!cpufreq_driver || !cpu_max_freq) { + if (!cpufreq_driver || !cpu_max_freq || (cpu > NR_CPUS)) { up(&cpufreq_driver_sem); return -EINVAL; } @@ -377,7 +377,20 @@ up(&cpufreq_driver_sem); - return cpufreq_set_policy(&policy); + if (policy.cpu == CPUFREQ_ALL_CPUS) + { + unsigned int i; + unsigned int ret = 0; + for (i=0; icpu == CPUFREQ_ALL_CPUS) { - for (i=0;ipolicy[i].min = policy->min; - cpufreq_driver->policy[i].max = policy->max; - cpufreq_driver->policy[i].policy = policy->policy; - } - } else { - cpufreq_driver->policy[policy->cpu].min = policy->min; - cpufreq_driver->policy[policy->cpu].max = policy->max; - cpufreq_driver->policy[policy->cpu].policy = policy->policy; - } + cpufreq_driver->policy[policy->cpu].min = policy->min; + cpufreq_driver->policy[policy->cpu].max = policy->max; + cpufreq_driver->policy[policy->cpu].policy = policy->policy; #ifdef CONFIG_CPU_FREQ_24_API - if (policy->cpu == CPUFREQ_ALL_CPUS) { - for (i=0;imax; - } else - cpu_cur_freq[policy->cpu] = policy->max; + cpu_cur_freq[policy->cpu] = policy->max; #endif ret = cpufreq_driver->setpolicy(policy); @@ -920,15 +920,6 @@ /********************************************************************* - * DYNAMIC CPUFREQ SWITCHING * - *********************************************************************/ -#ifdef CONFIG_CPU_FREQ_DYNAMIC -/* TBD */ -#endif /* CONFIG_CPU_FREQ_DYNAMIC */ - - - -/********************************************************************* * EXTERNALLY AFFECTING FREQUENCY CHANGES * *********************************************************************/ @@ -973,12 +964,7 @@ adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_POSTCHANGE, freqs); #ifdef CONFIG_CPU_FREQ_24_API - if (freqs->cpu == CPUFREQ_ALL_CPUS) { - int i; - for (i=0;inew; - } else - cpu_cur_freq[freqs->cpu] = freqs->new; + cpu_cur_freq[freqs->cpu] = freqs->new; #endif break; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/