Skip to contentSkip to conversation

clk: renesas: Remove unneeded semicolon

PATCH In review Yang Li 2 participants 4 messages Jun 15, 2021 – Jun 16, 2021

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/2 clk: renesas: Remove unneeded semicolon

Eliminate the following coccicheck warning:
./drivers/clk/renesas/renesas-rzg2l-cpg.c:299:2-3: Unneeded semicolon

---
 drivers/clk/renesas/renesas-rzg2l-cpg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/renesas-rzg2l-cpg.c +1 -1
index 5009b9e..1fcea17 100644
@@ -296,7 +296,7 @@ static unsigned long rzg2l_cpg_pll_clk_recalc_rate(struct clk_hw *hw,
 		break;
 	default:
 		goto fail;
-	};
+	}
 
 	if (IS_ERR_OR_NULL(clk))
 		goto fail;
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 2/2 clk: renesas: fix return value and unused assignment

Currently the function returns NULL on error, so exact error code is lost. This patch changes return convention of the function to use ERR_PTR() on error instead.

---
 drivers/clk/renesas/renesas-rzg2l-cpg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/renesas-rzg2l-cpg.c +1 -1
index 1fcea17..5bc7e87 100644
@@ -183,7 +183,7 @@ static unsigned long rzg2l_cpg_pll_clk_recalc_rate(struct clk_hw *hw,
 	pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL);
 	if (!pll_clk) {
 		clk = ERR_PTR(-ENOMEM);
-		return NULL;
+		return clk;
 	}
 
 	parent_name = __clk_get_name(parent);
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [PATCH -next 2/2] clk: renesas: fix return value and unused assignment

Hi Yang,

Quoted 15 lines · Yang Li

Currently the function returns NULL on error, so exact error code is lost. This patch changes return convention of the function to use ERR_PTR() on error instead.

---
 drivers/clk/renesas/renesas-rzg2l-cpg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/renesas-rzg2l-cpg.c +0 -0
index 1fcea17..5bc7e87 100644

drivers/clk/renesas/renesas-rzg2l-cpg.c static unsigned long rzg2l_cpg_pll_clk_recalc_rate(struct clk_hw *hw, · line 187

Quoted 6 lines
drivers/clk/renesas/renesas-rzg2l-cpg.c +1 -1
@@ -183,7 +183,7 @@ static unsigned long rzg2l_cpg_pll_clk_recalc_rate(struct clk_hw *hw,
        pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL);
        if (!pll_clk) {
                clk = ERR_PTR(-ENOMEM);
-               return NULL;
+               return clk;
        }

Why not simply "return ERR_PTR(-ENOMEM);"?

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Reviewed-by on v1 1/2
#3 lore raw
In reply to Yang Li
Quoted 5 lines · Yang Li

Eliminate the following coccicheck warning:
./drivers/clk/renesas/renesas-rzg2l-cpg.c:299:2-3: Unneeded semicolon

i.e. will queue in renesas-clk-for-v5.15.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds