Skip to contentSkip to conversation

clk: baikal-t1: remove redundant assignment to variable 'divider'

PATCH Applied Colin King 3 participants 3 messages Jun 2, 2020 – Jun 9, 2020

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 clk: baikal-t1: remove redundant assignment to variable 'divider'

From: Colin Ian King <[email protected]>

The variable divider is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/clk/baikal-t1/ccu-div.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/baikal-t1/ccu-div.c +1 -1
index bd40f5936f08..4062092d67f9 100644
@@ -248,7 +248,7 @@ static int ccu_div_var_set_rate_fast(struct clk_hw *hw, unsigned long rate,
 				     unsigned long parent_rate)
 {
 	struct ccu_div *div = to_ccu_div(hw);
-	unsigned long flags, divider = 1;
+	unsigned long flags, divider;
 	u32 val;
 
 	divider = ccu_div_var_calc_divider(rate, parent_rate, div->mask);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Colin King

From: Colin Ian King <[email protected]>

The variable divider is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Right. Thanks.

Quoted 23 lines

Addresses-Coverity: ("Unused value")

---
 drivers/clk/baikal-t1/ccu-div.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/baikal-t1/ccu-div.c +1 -1
index bd40f5936f08..4062092d67f9 100644
@@ -248,7 +248,7 @@ static int ccu_div_var_set_rate_fast(struct clk_hw *hw, unsigned long rate,
 				     unsigned long parent_rate)
 {
 	struct ccu_div *div = to_ccu_div(hw);
-	unsigned long flags, divider = 1;
+	unsigned long flags, divider;
 	u32 val;
 
 	divider = ccu_div_var_calc_divider(rate, parent_rate, div->mask);
Signature · 1 line
2.25.1