Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1740174 > unrolled thread

[PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-09-26 22:10 +0200
Last post2017-09-27 09:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] clk: hisilicon: Delete an error message for a failed memory  allocation in hisi_register_clkgate_sep() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-26 22:10 +0200
    Re: [PATCH] clk: hisilicon: Delete an error message for a failed  memory allocation in hisi_register_clkgate_sep() Leo Yan <leo.yan@linaro.org> - 2017-09-27 09:00 +0200

#1740174 — [PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-26 22:10 +0200
Subject[PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()
Message-ID<uu4l5-V9-27@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1740437 — Re: [PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()

FromLeo Yan <leo.yan@linaro.org>
Date2017-09-27 09:00 +0200
SubjectRe: [PATCH] clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()
Message-ID<uueu6-7gi-11@gated-at.bofh.it>
In reply to#1740174
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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web