]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sh: remove bogus highest / lowest logic from clock rate rounding
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 25 Jun 2010 07:19:39 +0000 (07:19 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 2 Jul 2010 09:07:51 +0000 (18:07 +0900)
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>
drivers/sh/clk.c

index 936c93aaef11b4c518b9093a29bbcab46b28b59e..cede14e34507aa0dd6d9551a937822a5257f3f85 100644 (file)
@@ -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;
 }