public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: clocking-wizard: Remove redundant initialization of pointer div_addr
@ 2024-02-23 13:43 Colin Ian King
  2024-02-26  8:45 ` Michal Simek
  2024-02-28 22:52 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2024-02-23 13:43 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Michal Simek, linux-clk,
	linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

The pointer div_addr is being assigned a value that is never used, it is
being re-assigned a different value near the end of the function where
it is being read in the next statement. The initialization is redundant
and can be removed.

Cleans up clang scan build warning:
drivers/clk/xilinx/clk-xlnx-clock-wizard.c:501:16: warning: Value stored
to 'div_addr' during its initialization is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
index 6a6e5d9292e8..19eb3fb7ae31 100644
--- a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
+++ b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
@@ -498,7 +498,7 @@ static int clk_wzrd_dynamic_all_nolock(struct clk_hw *hw, unsigned long rate,
 {
 	struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
 	unsigned long vco_freq, rate_div, clockout0_div;
-	void __iomem *div_addr = divider->base;
+	void __iomem *div_addr;
 	u32 reg, pre, f;
 	int err;
 
-- 
2.39.2


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

* Re: [PATCH] clk: clocking-wizard: Remove redundant initialization of pointer div_addr
  2024-02-23 13:43 [PATCH] clk: clocking-wizard: Remove redundant initialization of pointer div_addr Colin Ian King
@ 2024-02-26  8:45 ` Michal Simek
  2024-02-28 22:52 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2024-02-26  8:45 UTC (permalink / raw)
  To: Colin Ian King, Michael Turquette, Stephen Boyd, linux-clk,
	linux-arm-kernel
  Cc: kernel-janitors, linux-kernel



On 2/23/24 14:43, Colin Ian King wrote:
> The pointer div_addr is being assigned a value that is never used, it is
> being re-assigned a different value near the end of the function where
> it is being read in the next statement. The initialization is redundant
> and can be removed.
> 
> Cleans up clang scan build warning:
> drivers/clk/xilinx/clk-xlnx-clock-wizard.c:501:16: warning: Value stored
> to 'div_addr' during its initialization is never read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>   drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
> index 6a6e5d9292e8..19eb3fb7ae31 100644
> --- a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
> +++ b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
> @@ -498,7 +498,7 @@ static int clk_wzrd_dynamic_all_nolock(struct clk_hw *hw, unsigned long rate,
>   {
>   	struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
>   	unsigned long vco_freq, rate_div, clockout0_div;
> -	void __iomem *div_addr = divider->base;
> +	void __iomem *div_addr;
>   	u32 reg, pre, f;
>   	int err;
>   

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

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

* Re: [PATCH] clk: clocking-wizard: Remove redundant initialization of pointer div_addr
  2024-02-23 13:43 [PATCH] clk: clocking-wizard: Remove redundant initialization of pointer div_addr Colin Ian King
  2024-02-26  8:45 ` Michal Simek
@ 2024-02-28 22:52 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2024-02-28 22:52 UTC (permalink / raw)
  To: Colin Ian King, Michael Turquette, Michal Simek, linux-arm-kernel,
	linux-clk
  Cc: kernel-janitors, linux-kernel

Quoting Colin Ian King (2024-02-23 05:43:47)
> The pointer div_addr is being assigned a value that is never used, it is
> being re-assigned a different value near the end of the function where
> it is being read in the next statement. The initialization is redundant
> and can be removed.
> 
> Cleans up clang scan build warning:
> drivers/clk/xilinx/clk-xlnx-clock-wizard.c:501:16: warning: Value stored
> to 'div_addr' during its initialization is never read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---

Applied to clk-next

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

end of thread, other threads:[~2024-02-28 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-23 13:43 [PATCH] clk: clocking-wizard: Remove redundant initialization of pointer div_addr Colin Ian King
2024-02-26  8:45 ` Michal Simek
2024-02-28 22:52 ` Stephen Boyd

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