summaryrefslogtreecommitdiffstats
path: root/drivers/sh/clk.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-06-25 09:19:39 +0200
committerPaul Mundt <lethal@linux-sh.org>2010-07-02 11:07:51 +0200
commit088bcc2aff25f31f1497f8196fa02c8cd2a43f68 (patch)
tree8426693a95cdd91bec285ad86e95132e3e94bf35 /drivers/sh/clk.c
parentsh: move a debug printk() to a more meaningful location in the clock driver (diff)
downloadlinux-088bcc2aff25f31f1497f8196fa02c8cd2a43f68.tar.xz
linux-088bcc2aff25f31f1497f8196fa02c8cd2a43f68.zip
sh: remove bogus highest / lowest logic from clock rate rounding
The use of highest and lowest in clk_rate_table_round() is completely bogus and superfluous. Remove it. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh/clk.c')
-rw-r--r--drivers/sh/clk.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/drivers/sh/clk.c b/drivers/sh/clk.c
index 936c93aaef11..cede14e34507 100644
--- a/drivers/sh/clk.c
+++ b/drivers/sh/clk.c
@@ -73,22 +73,14 @@ long clk_rate_table_round(struct clk *clk,
{
unsigned long rate_error, rate_error_prev = ~0UL;
unsigned long rate_best_fit = rate;
- unsigned long highest, lowest;
int i;
- highest = lowest = 0;
-
for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
unsigned long freq = freq_table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID)
continue;
- if (freq > highest)
- highest = freq;
- if (freq < lowest)
- lowest = freq;
-
rate_error = abs(freq - rate);
if (rate_error < rate_error_prev) {
rate_best_fit = freq;
@@ -99,11 +91,6 @@ long clk_rate_table_round(struct clk *clk,
break;
}
- if (rate >= highest)
- rate_best_fit = highest;
- if (rate <= lowest)
- rate_best_fit = lowest;
-
return rate_best_fit;
}