clk: samsung: exynos5420: Remove useless check for return value of samsung_clk_init
Subsystems (3)
Krzysztof Kozlowski
maintainerPATCH 1/1 clk: samsung: exynos5420: Remove useless check for return value of samsung_clk_init
The samsung_clk_init() cannot return NULL. Either it returns allocated memory or it panics.
--- drivers/clk/samsung/clk-exynos5420.c | 2 -- 1 file changed, 2 deletions(-)
drivers/clk/samsung/clk-exynos5420.c +0 -2
@@ -1356,8 +1356,6 @@ static void __init exynos5x_clk_init(struct device_node *np, exynos5x_soc = soc; ctx =samsung_clk_init (np, reg_base,CLK_NR_CLKS ); -if (!ctx) -panic ("%s: unable to allocate context.\n" , __func__); samsung_clk_of_register_fixed_ext(ctx, exynos5x_fixed_rate_ext_clks, ARRAY_SIZE(exynos5x_fixed_rate_ext_clks),
Signature · 1 line
2.5.0
Hello Krzysztof,
Quoted 13 lines · Krzysztof Kozlowski
The
samsung_clk_init()cannot return NULL. Either it returns allocated memory or it panics.Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/clk/samsung/clk-exynos5420.c | 2 -- 1 file changed, 2 deletions(-)drivers/clk/samsung/clk-exynos5420.c +0
-0
drivers/clk/samsung/clk-exynos5420.c static void __init exynos5x_clk_init(struct device_node *np, · line 1359
Quoted 6 lines
drivers/clk/samsung/clk-exynos5420.c +0
-2@@ -1356,8 +1356,6 @@ static void __init exynos5x_clk_init(struct device_node *np, exynos5x_soc = soc; ctx =samsung_clk_init (np, reg_base,CLK_NR_CLKS ); -if (!ctx) -panic ("%s: unable to allocate context.\n" , __func__);
Indeed, the check is superfluous. I see that most callers [0] currently do the same, so probably makes sense to remove those too in this patch.
[0]:drivers/clk/samsung/clk-exynos4.cdrivers/clk/samsung/clk-exynos5250.cdrivers/clk/samsung/clk-exynos5440.cdrivers/clk/samsung/clk-s3c2410.cdrivers/clk/samsung/clk-s3c2412.cdrivers/clk/samsung/clk-s3c2443.cdrivers/clk/samsung/clk-s3c64xx.cdrivers/clk/samsung/clk-s5pv210.c
Best regards,
Signature · 3 lines
Javier Martinez Canillas Open Source Group Samsung Research America
Krzysztof Kozlowski
maintainerQuoted 26 lines · Javier Martinez Canillas
Hello Krzysztof,
Quoted 13 lines · Krzysztof Kozlowski
The
samsung_clk_init()cannot return NULL. Either it returns allocated memory or it panics.Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/clk/samsung/clk-exynos5420.c | 2 -- 1 file changed, 2 deletions(-)drivers/clk/samsung/clk-exynos5420.c +0
-0drivers/clk/samsung/clk-exynos5420.c static void __init exynos5x_clk_init(struct device_node *np, · line 1359
Quoted 6 lines
drivers/clk/samsung/clk-exynos5420.c +0
-2@@ -1356,8 +1356,6 @@ static void __init exynos5x_clk_init(struct device_node *np, exynos5x_soc = soc; ctx =samsung_clk_init (np, reg_base,CLK_NR_CLKS ); -if (!ctx) -panic ("%s: unable to allocate context.\n" , __func__);Indeed, the check is superfluous. I see that most callers [0] currently do the same, so probably makes sense to remove those too in this patch.
Quoted 1 line
Reviewed-by Javier Martinez Canillas <[email protected]>
Thanks, I'll change this everywhere.
Best regards,
Krzysztof