Linux-Clk Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] clk: samsung: Remove redundant check in samsung_cmu_register_one
@ 2020-01-21 23:33 ` Aditya Pakki
  2020-01-22  1:00   ` Chanwoo Choi
  2020-02-12 23:38   ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Aditya Pakki @ 2020-01-21 23:33 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Sylwester Nawrocki, Tomasz Figa, Chanwoo Choi,
	Michael Turquette, Stephen Boyd, linux-samsung-soc, linux-clk,
	linux-kernel

Consistent with other instances of samsung_clk_init, the check
if ctx is NULL is redundant. The function currently does not
return NULL.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 drivers/clk/samsung/clk.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c
index dad31308c071..1949ae7851b2 100644
--- a/drivers/clk/samsung/clk.c
+++ b/drivers/clk/samsung/clk.c
@@ -356,10 +356,6 @@ struct samsung_clk_provider * __init samsung_cmu_register_one(
 	}
 
 	ctx = samsung_clk_init(np, reg_base, cmu->nr_clk_ids);
-	if (!ctx) {
-		panic("%s: unable to allocate ctx\n", __func__);
-		return ctx;
-	}
 
 	if (cmu->pll_clks)
 		samsung_clk_register_pll(ctx, cmu->pll_clks, cmu->nr_pll_clks,
-- 
2.20.1


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

* Re: [PATCH] clk: samsung: Remove redundant check in samsung_cmu_register_one
  2020-01-21 23:33 ` [PATCH] clk: samsung: Remove redundant check in samsung_cmu_register_one Aditya Pakki
@ 2020-01-22  1:00   ` Chanwoo Choi
  2020-02-12 23:38   ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Chanwoo Choi @ 2020-01-22  1:00 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: kjlu, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd, linux-samsung-soc, linux-clk, linux-kernel

On 1/22/20 8:33 AM, Aditya Pakki wrote:
> Consistent with other instances of samsung_clk_init, the check
> if ctx is NULL is redundant. The function currently does not
> return NULL.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
>  drivers/clk/samsung/clk.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c
> index dad31308c071..1949ae7851b2 100644
> --- a/drivers/clk/samsung/clk.c
> +++ b/drivers/clk/samsung/clk.c
> @@ -356,10 +356,6 @@ struct samsung_clk_provider * __init samsung_cmu_register_one(
>  	}
>  
>  	ctx = samsung_clk_init(np, reg_base, cmu->nr_clk_ids);
> -	if (!ctx) {
> -		panic("%s: unable to allocate ctx\n", __func__);
> -		return ctx;
> -	}
>  
>  	if (cmu->pll_clks)
>  		samsung_clk_register_pll(ctx, cmu->pll_clks, cmu->nr_pll_clks,
> 

If samsung_clk_init() fail to allocate the memory for 'ctx',
call panic() without return. As the patch description,
samsung_clk_init() either call panic() or return
the correct 'ctx' instance. It looks good to me.

Acked-by: Chanwoo Choi <cw00.choi@samsung.com>

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

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

* Re: [PATCH] clk: samsung: Remove redundant check in samsung_cmu_register_one
  2020-01-21 23:33 ` [PATCH] clk: samsung: Remove redundant check in samsung_cmu_register_one Aditya Pakki
  2020-01-22  1:00   ` Chanwoo Choi
@ 2020-02-12 23:38   ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2020-02-12 23:38 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Sylwester Nawrocki, Tomasz Figa, Chanwoo Choi,
	Michael Turquette, linux-samsung-soc, linux-clk, linux-kernel

Quoting Aditya Pakki (2020-01-21 15:33:49)
> Consistent with other instances of samsung_clk_init, the check
> if ctx is NULL is redundant. The function currently does not
> return NULL.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---

Applied to clk-next

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200121233357epcas1p2ed13efb902d2b30c0ddd426e84351b9f@epcas1p2.samsung.com>
2020-01-21 23:33 ` [PATCH] clk: samsung: Remove redundant check in samsung_cmu_register_one Aditya Pakki
2020-01-22  1:00   ` Chanwoo Choi
2020-02-12 23:38   ` Stephen Boyd

Linux-Clk Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-clk/0 linux-clk/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-clk linux-clk/ https://lore.kernel.org/linux-clk \
		linux-clk@vger.kernel.org
	public-inbox-index linux-clk

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-clk


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git