From patchwork Fri Jun 25 07:19:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 108001 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5P7JWbm019487 for ; Fri, 25 Jun 2010 07:19:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752035Ab0FYHTc (ORCPT ); Fri, 25 Jun 2010 03:19:32 -0400 Received: from mail.gmx.net ([213.165.64.20]:60530 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751734Ab0FYHTb (ORCPT ); Fri, 25 Jun 2010 03:19:31 -0400 Received: (qmail invoked by alias); 25 Jun 2010 07:19:29 -0000 Received: from p57BD1D04.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.29.4] by mail.gmx.net (mp071) with SMTP; 25 Jun 2010 09:19:29 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1+yjH4zFHey5Jq9lXnd2VOB1k1vhjaSac1vnKgOmt Wd02/yPu0CGBgO Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1OS3CN-0003p5-Eu for linux-sh@vger.kernel.org; Fri, 25 Jun 2010 09:19:39 +0200 Date: Fri, 25 Jun 2010 09:19:39 +0200 (CEST) From: Guennadi Liakhovetski To: "linux-sh@vger.kernel.org" Subject: [PATCH] sh: remove bogus highest / lowest logic from clock rate rounding Message-ID: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 25 Jun 2010 07:19:33 +0000 (UTC) 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; }