* [PATCH -next 1/2] clk: renesas: Remove unneeded semicolon
@ 2021-06-15 9:39 Yang Li
2021-06-15 9:39 ` [PATCH -next 2/2] clk: renesas: fix return value and unused assignment Yang Li
2021-06-16 11:54 ` [PATCH -next 1/2] clk: renesas: Remove unneeded semicolon Geert Uytterhoeven
0 siblings, 2 replies; 4+ messages in thread
From: Yang Li @ 2021-06-15 9:39 UTC (permalink / raw)
To: geert+renesas
Cc: mturquette, sboyd, linux-renesas-soc, linux-clk, linux-kernel, Yang Li
Eliminate the following coccicheck warning:
./drivers/clk/renesas/renesas-rzg2l-cpg.c:299:2-3: Unneeded semicolon
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/clk/renesas/renesas-rzg2l-cpg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/renesas/renesas-rzg2l-cpg.c b/drivers/clk/renesas/renesas-rzg2l-cpg.c
index 5009b9e..1fcea17 100644
--- a/drivers/clk/renesas/renesas-rzg2l-cpg.c
+++ b/drivers/clk/renesas/renesas-rzg2l-cpg.c
@@ -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;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH -next 2/2] clk: renesas: fix return value and unused assignment
2021-06-15 9:39 [PATCH -next 1/2] clk: renesas: Remove unneeded semicolon Yang Li
@ 2021-06-15 9:39 ` Yang Li
2021-06-16 11:57 ` Geert Uytterhoeven
2021-06-16 11:54 ` [PATCH -next 1/2] clk: renesas: Remove unneeded semicolon Geert Uytterhoeven
1 sibling, 1 reply; 4+ messages in thread
From: Yang Li @ 2021-06-15 9:39 UTC (permalink / raw)
To: geert+renesas
Cc: mturquette, sboyd, linux-renesas-soc, linux-clk, linux-kernel, 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.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/clk/renesas/renesas-rzg2l-cpg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/renesas/renesas-rzg2l-cpg.c b/drivers/clk/renesas/renesas-rzg2l-cpg.c
index 1fcea17..5bc7e87 100644
--- a/drivers/clk/renesas/renesas-rzg2l-cpg.c
+++ b/drivers/clk/renesas/renesas-rzg2l-cpg.c
@@ -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);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next 1/2] clk: renesas: Remove unneeded semicolon
2021-06-15 9:39 [PATCH -next 1/2] clk: renesas: Remove unneeded semicolon Yang Li
2021-06-15 9:39 ` [PATCH -next 2/2] clk: renesas: fix return value and unused assignment Yang Li
@ 2021-06-16 11:54 ` Geert Uytterhoeven
1 sibling, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-06-16 11:54 UTC (permalink / raw)
To: yang.lee
Cc: Michael Turquette, Stephen Boyd, Linux-Renesas, linux-clk,
Linux Kernel Mailing List
On Tue, Jun 15, 2021 at 11:39 AM Yang Li <yang.lee@linux.alibaba.com> wrote:
> Eliminate the following coccicheck warning:
> ./drivers/clk/renesas/renesas-rzg2l-cpg.c:299:2-3: Unneeded semicolon
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-clk-for-v5.15.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next 2/2] clk: renesas: fix return value and unused assignment
2021-06-15 9:39 ` [PATCH -next 2/2] clk: renesas: fix return value and unused assignment Yang Li
@ 2021-06-16 11:57 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-06-16 11:57 UTC (permalink / raw)
To: yang.lee
Cc: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
Linux-Renesas, linux-clk, Linux Kernel Mailing List
Hi Yang,
On Tue, Jun 15, 2021 at 11:39 AM Yang Li <yang.lee@linux.alibaba.com> wrote:
> 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.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
> drivers/clk/renesas/renesas-rzg2l-cpg.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/renesas/renesas-rzg2l-cpg.c b/drivers/clk/renesas/renesas-rzg2l-cpg.c
> index 1fcea17..5bc7e87 100644
> --- a/drivers/clk/renesas/renesas-rzg2l-cpg.c
> +++ b/drivers/clk/renesas/renesas-rzg2l-cpg.c
> @@ -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
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-06-16 11:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 9:39 [PATCH -next 1/2] clk: renesas: Remove unneeded semicolon Yang Li
2021-06-15 9:39 ` [PATCH -next 2/2] clk: renesas: fix return value and unused assignment Yang Li
2021-06-16 11:57 ` Geert Uytterhoeven
2021-06-16 11:54 ` [PATCH -next 1/2] clk: renesas: Remove unneeded semicolon Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).