diff mbox series

[clk-next] clk: imx: remove redundant initialization of ret to zero

Message ID 20181209150832.9366-1-colin.king@canonical.com (mailing list archive)
State Accepted, archived
Headers show
Series [clk-next] clk: imx: remove redundant initialization of ret to zero | expand

Commit Message

Colin King Dec. 9, 2018, 3:08 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/clk/imx/clk-composite-8m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Boyd Dec. 10, 2018, 5:53 p.m. UTC | #1
Quoting Colin King (2018-12-09 07:08:32)
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---

Applied to clk-next
Dan Carpenter Dec. 11, 2018, 9:48 a.m. UTC | #2
On Sun, Dec 09, 2018 at 03:08:32PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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
Colin King Dec. 11, 2018, 9:52 a.m. UTC | #3
On 11/12/2018 09:48, Dan Carpenter wrote:
> On Sun, Dec 09, 2018 at 03:08:32PM +0000, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> 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.

> 
> regards,
> dan carpenter
>
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c
index 6d9d3714b4df..527ade1d6933 100644
--- a/drivers/clk/imx/clk-composite-8m.c
+++ b/drivers/clk/imx/clk-composite-8m.c
@@ -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,