public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] clk: mmp: frac: Remove set but not used variable 'prev_rate'
@ 2019-05-25 14:25 YueHaibing
  2019-06-06 18:25 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-05-25 14:25 UTC (permalink / raw)
  To: mturquette, sboyd; +Cc: linux-kernel, linux-clk, YueHaibing

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/clk/mmp/clk-frac.c: In function clk_factor_set_rate:
drivers/clk/mmp/clk-frac.c:81:16: warning: variable prev_rate set but not used [-Wunused-but-set-variable]

It's never used and can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/clk/mmp/clk-frac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/mmp/clk-frac.c b/drivers/clk/mmp/clk-frac.c
index cb43d54735b0..90bf181f191a 100644
--- a/drivers/clk/mmp/clk-frac.c
+++ b/drivers/clk/mmp/clk-frac.c
@@ -78,11 +78,10 @@ static int clk_factor_set_rate(struct clk_hw *hw, unsigned long drate,
 	struct mmp_clk_factor_masks *masks = factor->masks;
 	int i;
 	unsigned long val;
-	unsigned long prev_rate, rate = 0;
+	unsigned long rate = 0;
 	unsigned long flags = 0;
 
 	for (i = 0; i < factor->ftbl_cnt; i++) {
-		prev_rate = rate;
 		rate = (((prate / 10000) * factor->ftbl[i].den) /
 			(factor->ftbl[i].num * factor->masks->factor)) * 10000;
 		if (rate > drate)
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] clk: mmp: frac: Remove set but not used variable 'prev_rate'
  2019-05-25 14:25 [PATCH -next] clk: mmp: frac: Remove set but not used variable 'prev_rate' YueHaibing
@ 2019-06-06 18:25 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2019-06-06 18:25 UTC (permalink / raw)
  To: YueHaibing, mturquette; +Cc: linux-kernel, linux-clk, YueHaibing

Quoting YueHaibing (2019-05-25 07:25:35)
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/clk/mmp/clk-frac.c: In function clk_factor_set_rate:
> drivers/clk/mmp/clk-frac.c:81:16: warning: variable prev_rate set but not used [-Wunused-but-set-variable]
> 
> It's never used and can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---

Applied to clk-next


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-06 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-25 14:25 [PATCH -next] clk: mmp: frac: Remove set but not used variable 'prev_rate' YueHaibing
2019-06-06 18:25 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox