linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()
@ 2017-09-26 20:05 SF Markus Elfring
  2017-09-27  6:52 ` Leo Yan
  2017-11-11  2:45 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-26 20:05 UTC (permalink / raw)
  To: linux-clk, Haojian Zhuang, Leo Yan, Michael Turquette, Stephen Boyd
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 26 Sep 2017 22:00:05 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/clk/hisilicon/clkgate-separated.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/clk/hisilicon/clkgate-separated.c b/drivers/clk/hisilicon/clkgate-separated.c
index 7908bc3c9ec7..f028bcffe12c 100644
--- a/drivers/clk/hisilicon/clkgate-separated.c
+++ b/drivers/clk/hisilicon/clkgate-separated.c
@@ -105,10 +105,8 @@ struct clk *hisi_register_clkgate_sep(struct device *dev, const char *name,
 	struct clk_init_data init;
 
 	sclk = kzalloc(sizeof(*sclk), GFP_KERNEL);
-	if (!sclk) {
-		pr_err("%s: fail to allocate separated gated clk\n", __func__);
+	if (!sclk)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	init.name = name;
 	init.ops = &clkgate_separated_ops;
-- 
2.14.1

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

* Re: [PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()
  2017-09-26 20:05 [PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep() SF Markus Elfring
@ 2017-09-27  6:52 ` Leo Yan
  2017-11-11  2:45 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Leo Yan @ 2017-09-27  6:52 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-clk, Haojian Zhuang, Michael Turquette, Stephen Boyd, LKML,
	kernel-janitors

Hi Markus,

On Tue, Sep 26, 2017 at 10:05:59PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 26 Sep 2017 22:00:05 +0200
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

This patch is good for me, it's true that below error log senstence is
redundant with its caller hisi_clk_register_gate_sep().

Reviewed-by: Leo Yan <leo.yan@linaro.org>

> ---
>  drivers/clk/hisilicon/clkgate-separated.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/clk/hisilicon/clkgate-separated.c b/drivers/clk/hisilicon/clkgate-separated.c
> index 7908bc3c9ec7..f028bcffe12c 100644
> --- a/drivers/clk/hisilicon/clkgate-separated.c
> +++ b/drivers/clk/hisilicon/clkgate-separated.c
> @@ -105,10 +105,8 @@ struct clk *hisi_register_clkgate_sep(struct device *dev, const char *name,
>  	struct clk_init_data init;
>  
>  	sclk = kzalloc(sizeof(*sclk), GFP_KERNEL);
> -	if (!sclk) {
> -		pr_err("%s: fail to allocate separated gated clk\n", __func__);
> +	if (!sclk)
>  		return ERR_PTR(-ENOMEM);
> -	}
>  
>  	init.name = name;
>  	init.ops = &clkgate_separated_ops;
> -- 
> 2.14.1
> 

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

* Re: [PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()
  2017-09-26 20:05 [PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep() SF Markus Elfring
  2017-09-27  6:52 ` Leo Yan
@ 2017-11-11  2:45 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2017-11-11  2:45 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-clk, Haojian Zhuang, Leo Yan, Michael Turquette, LKML,
	kernel-janitors

On 09/26, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 26 Sep 2017 22:00:05 +0200
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

end of thread, other threads:[~2017-11-11  2:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-26 20:05 [PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep() SF Markus Elfring
2017-09-27  6:52 ` Leo Yan
2017-11-11  2:45 ` Stephen Boyd

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).