From: Stratos Karafotis Date: Wed, 14 May 2014 18:05:52 +0000 (+0300) Subject: cpufreq: Break out early when frequency equals target_freq X-Git-Tag: omap-for-v3.16/fixes-against-rc1~39^2~5^2~1^2^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e4988563d3c92ba756d8c86917fc1b594ebe855;p=pandora-kernel.git cpufreq: Break out early when frequency equals target_freq Many drivers keep frequencies in frequency table in ascending or descending order. When governor tries to change to policy->min or policy->max respectively then the cpufreq_frequency_table_target could return on first iteration. This will save some iteration cycles. So, break out early when a frequency in cpufreq_frequency_table equals to target one. Testing this during kernel compilation using ondemand governor with a frequency table in ascending order, the cpufreq_frequency_table_target returned early on the first iteration at about 30% of times called. Signed-off-by: Stratos Karafotis Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- Reading git-diff-tree failed