Skip to contentSkip to conversation

clk: imx: remove redundant initialization of ret to zero

PATCH Applied Colin King 3 participants 4 messages Dec 9, 2018 – Dec 11, 2018

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 clk: imx: remove redundant initialization of ret to zero

From: Colin Ian King <[email protected]>

The initialization of ret is redundant as it is being re-assigned to the return value from the call to imx8m_clk_composite_compute_dividers. Clean this up by removing the initialization.

---
 drivers/clk/imx/clk-composite-8m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-composite-8m.c +1 -1
index 6d9d3714b4df..527ade1d6933 100644
@@ -93,7 +93,7 @@ static int imx8m_clk_composite_divider_set_rate(struct clk_hw *hw,
 	unsigned long flags = 0;
 	int prediv_value;
 	int div_value;
-	int ret = 0;
+	int ret;
 	u32 val;
 
 	ret = imx8m_clk_composite_compute_dividers(rate, parent_rate,
Signature · 1 line
2.19.1
maintainer Applied
#1 lore raw

Quoting Colin King (2018-12-09 07:08:32)

Quoted 8 lines

From: Colin Ian King <[email protected]>

The initialization of ret is redundant as it is being re-assigned to the return value from the call to imx8m_clk_composite_compute_dividers. Clean this up by removing the initialization.

---

Applied to clk-next

#2 lore raw
In reply to Colin King
Quoted 6 lines · Colin King

From: Colin Ian King <[email protected]>

The initialization of ret is redundant as it is being re-assigned to the return value from the call to imx8m_clk_composite_compute_dividers. Clean this up by removing the initialization.

Just curious, is there a static checker which complains about this as dead code?

regards,
dan carpenter

#3 lore raw
Quoted 10 lines · Dan Carpenter
Quoted 6 lines · Colin King

From: Colin Ian King <[email protected]>

The initialization of ret is redundant as it is being re-assigned to the return value from the call to imx8m_clk_composite_compute_dividers. Clean this up by removing the initialization.

Just curious, is there a static checker which complains about this as dead code?

If I recall correctly, cppcheck, but I may be wrong, I use several different tools.

Quoted 4 lines

regards,
dan carpenter