linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][clk-next] clk: imx: remove redundant initialization of ret to zero
@ 2018-12-09 15:08 Colin King
  2018-12-10 17:53 ` Stephen Boyd
  2018-12-11  9:48 ` Dan Carpenter
  0 siblings, 2 replies; 4+ messages in thread
From: Colin King @ 2018-12-09 15:08 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Michael Turquette, Stephen Boyd,
	linux-arm-kernel, linux-clk
  Cc: kernel-janitors, linux-kernel

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(-)

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,
-- 
2.19.1


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

* Re: [PATCH][clk-next] clk: imx: remove redundant initialization of ret to zero
  2018-12-09 15:08 [PATCH][clk-next] clk: imx: remove redundant initialization of ret to zero Colin King
@ 2018-12-10 17:53 ` Stephen Boyd
  2018-12-11  9:48 ` Dan Carpenter
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2018-12-10 17:53 UTC (permalink / raw)
  To: Colin King, Fabio Estevam, Michael Turquette, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo,
	linux-arm-kernel, linux-clk
  Cc: kernel-janitors, linux-kernel

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


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

* Re: [PATCH][clk-next] clk: imx: remove redundant initialization of ret to zero
  2018-12-09 15:08 [PATCH][clk-next] clk: imx: remove redundant initialization of ret to zero Colin King
  2018-12-10 17:53 ` Stephen Boyd
@ 2018-12-11  9:48 ` Dan Carpenter
  2018-12-11  9:52   ` Colin Ian King
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2018-12-11  9:48 UTC (permalink / raw)
  To: Colin King
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Michael Turquette, Stephen Boyd,
	linux-arm-kernel, linux-clk, kernel-janitors, linux-kernel

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


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

* Re: [PATCH][clk-next] clk: imx: remove redundant initialization of ret to zero
  2018-12-11  9:48 ` Dan Carpenter
@ 2018-12-11  9:52   ` Colin Ian King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin Ian King @ 2018-12-11  9:52 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Michael Turquette, Stephen Boyd,
	linux-arm-kernel, linux-clk, kernel-janitors, linux-kernel

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
> 


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

end of thread, other threads:[~2018-12-11  9:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-09 15:08 [PATCH][clk-next] clk: imx: remove redundant initialization of ret to zero Colin King
2018-12-10 17:53 ` Stephen Boyd
2018-12-11  9:48 ` Dan Carpenter
2018-12-11  9:52   ` Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).