lkml.org 
[lkml]   [2021]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH][next] soc: xilinx: vcu: remove deadcode on null divider check
On Wed, 10 Feb 2021 18:49:38 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer 'divider' has previously been null checked followed by
> a return, hence the subsequent null check is redundant deadcode
> that can be removed. Clean up the code and remove it.
>
> Fixes: 9c789deea206 ("soc: xilinx: vcu: implement clock provider for output clocks")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/clk/xilinx/xlnx_vcu.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c
> index d66b1315114e..607936d7a413 100644
> --- a/drivers/clk/xilinx/xlnx_vcu.c
> +++ b/drivers/clk/xilinx/xlnx_vcu.c
> @@ -512,9 +512,6 @@ static void xvcu_clk_hw_unregister_leaf(struct clk_hw *hw)
>
> mux = clk_hw_get_parent(divider);
> clk_hw_unregister_mux(mux);
> - if (!divider)
> - return;
> -
> clk_hw_unregister_divider(divider);

Thanks for pointing this out. There is actually a different bug there.

There should have been a check for !mux before unregistering the mux:

mux = clk_hw_get_parent(divider);
clk_hw_unregister_divider(divider);
if (!mux)
return;

clk_hw_unregister_mux(mux);

Michael

> }
>
> --
> 2.30.0
>
>

\
 
 \ /
  Last update: 2021-02-11 08:34    [W:1.776 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site