diff mbox

sh: remove bogus highest / lowest logic from clock rate rounding

Message ID Pine.LNX.4.64.1006250918150.1223@axis700.grange (mailing list archive)
State Accepted
Commit 088bcc2aff25f31f1497f8196fa02c8cd2a43f68
Headers show

Commit Message

Guennadi Liakhovetski June 25, 2010, 7:19 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/sh/clk.c b/drivers/sh/clk.c
index 5d84ada..691f829 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;
 }