Skip to contentSkip to conversation

clk: samsung: exynos5420: Remove useless check for return value of samsung_clk_init

PATCH Superseded Krzysztof Kozlowski 2 participants 3 messages May 8, 2016 – May 9, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 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
index 92382cef9f90..770c0f007c6b 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw

Hello Krzysztof,

Quoted 13 lines · Krzysztof Kozlowski

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 -0
index 92382cef9f90..770c0f007c6b 100644

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.c
drivers/clk/samsung/clk-exynos5250.c
drivers/clk/samsung/clk-exynos5440.c
drivers/clk/samsung/clk-s3c2410.c
drivers/clk/samsung/clk-s3c2412.c
drivers/clk/samsung/clk-s3c2443.c
drivers/clk/samsung/clk-s3c64xx.c
drivers/clk/samsung/clk-s5pv210.c

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
author maintainer
#2 lore raw
Quoted 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.

---
 drivers/clk/samsung/clk-exynos5420.c | 2 --
 1 file changed, 2 deletions(-)
drivers/clk/samsung/clk-exynos5420.c +0 -0
index 92382cef9f90..770c0f007c6b 100644

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.

Quoted 1 line

Thanks, I'll change this everywhere.

Best regards,
Krzysztof