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


Groups > linux.kernel > #1740944 > unrolled thread

[PATCH 1/2] clk/ux500: Delete an error message for a failed memory allocation in three functions

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-09-27 20:50 +0200
Last post2017-09-28 18:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] clk/ux500: Delete an error message for a failed memory  allocation in three functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-27 20:50 +0200
    Re: [PATCH 1/2] clk/ux500: Delete an error message for a failed  memory allocation in three functions Ulf Hansson <ulf.hansson@linaro.org> - 2017-09-28 18:10 +0200

#1740944 — [PATCH 1/2] clk/ux500: Delete an error message for a failed memory allocation in three functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-27 20:50 +0200
Subject[PATCH 1/2] clk/ux500: Delete an error message for a failed memory allocation in three functions
Message-ID<uupzb-6Km-13@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 27 Sep 2017 20:23:58 +0200

Omit extra messages for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/clk/ux500/clk-prcc.c    | 4 +---
 drivers/clk/ux500/clk-prcmu.c   | 4 +---
 drivers/clk/ux500/clk-sysctrl.c | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/ux500/clk-prcc.c b/drivers/clk/ux500/clk-prcc.c
index f50592775c9d..5ca07e6d1f64 100644
--- a/drivers/clk/ux500/clk-prcc.c
+++ b/drivers/clk/ux500/clk-prcc.c
@@ -108,10 +108,8 @@ static struct clk *clk_reg_prcc(const char *name,
 	}
 
 	clk = kzalloc(sizeof(struct clk_prcc), GFP_KERNEL);
-	if (!clk) {
-		pr_err("clk_prcc: %s could not allocate clk\n", __func__);
+	if (!clk)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	clk->base = ioremap(phy_base, SZ_4K);
 	if (!clk->base)
diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c
index 6e3e16b2e5ca..c137934f23ab 100644
--- a/drivers/clk/ux500/clk-prcmu.c
+++ b/drivers/clk/ux500/clk-prcmu.c
@@ -259,10 +259,8 @@ static struct clk *clk_reg_prcmu(const char *name,
 	}
 
 	clk = kzalloc(sizeof(struct clk_prcmu), GFP_KERNEL);
-	if (!clk) {
-		pr_err("clk_prcmu: %s could not allocate clk\n", __func__);
+	if (!clk)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	clk->cg_sel = cg_sel;
 	clk->is_prepared = 1;
diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c
index 8a4e93ce1e42..e0a834c08a04 100644
--- a/drivers/clk/ux500/clk-sysctrl.c
+++ b/drivers/clk/ux500/clk-sysctrl.c
@@ -140,10 +140,8 @@ static struct clk *clk_reg_sysctrl(struct device *dev,
 	}
 
 	clk = devm_kzalloc(dev, sizeof(struct clk_sysctrl), GFP_KERNEL);
-	if (!clk) {
-		dev_err(dev, "clk_sysctrl: could not allocate clk\n");
+	if (!clk)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	/* set main clock registers */
 	clk->reg_sel[0] = reg_sel[0];
-- 
2.14.2

[toc] | [next] | [standalone]


#1741680 — Re: [PATCH 1/2] clk/ux500: Delete an error message for a failed memory allocation in three functions

FromUlf Hansson <ulf.hansson@linaro.org>
Date2017-09-28 18:10 +0200
SubjectRe: [PATCH 1/2] clk/ux500: Delete an error message for a failed memory allocation in three functions
Message-ID<uuJxU-2Gx-13@gated-at.bofh.it>
In reply to#1740944
On 27 September 2017 at 20:46, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 27 Sep 2017 20:23:58 +0200
>
> Omit extra messages for a memory allocation failure in these functions.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---
>  drivers/clk/ux500/clk-prcc.c    | 4 +---
>  drivers/clk/ux500/clk-prcmu.c   | 4 +---
>  drivers/clk/ux500/clk-sysctrl.c | 4 +---
>  3 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/clk/ux500/clk-prcc.c b/drivers/clk/ux500/clk-prcc.c
> index f50592775c9d..5ca07e6d1f64 100644
> --- a/drivers/clk/ux500/clk-prcc.c
> +++ b/drivers/clk/ux500/clk-prcc.c
> @@ -108,10 +108,8 @@ static struct clk *clk_reg_prcc(const char *name,
>         }
>
>         clk = kzalloc(sizeof(struct clk_prcc), GFP_KERNEL);
> -       if (!clk) {
> -               pr_err("clk_prcc: %s could not allocate clk\n", __func__);
> +       if (!clk)
>                 return ERR_PTR(-ENOMEM);
> -       }
>
>         clk->base = ioremap(phy_base, SZ_4K);
>         if (!clk->base)
> diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c
> index 6e3e16b2e5ca..c137934f23ab 100644
> --- a/drivers/clk/ux500/clk-prcmu.c
> +++ b/drivers/clk/ux500/clk-prcmu.c
> @@ -259,10 +259,8 @@ static struct clk *clk_reg_prcmu(const char *name,
>         }
>
>         clk = kzalloc(sizeof(struct clk_prcmu), GFP_KERNEL);
> -       if (!clk) {
> -               pr_err("clk_prcmu: %s could not allocate clk\n", __func__);
> +       if (!clk)
>                 return ERR_PTR(-ENOMEM);
> -       }
>
>         clk->cg_sel = cg_sel;
>         clk->is_prepared = 1;
> diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c
> index 8a4e93ce1e42..e0a834c08a04 100644
> --- a/drivers/clk/ux500/clk-sysctrl.c
> +++ b/drivers/clk/ux500/clk-sysctrl.c
> @@ -140,10 +140,8 @@ static struct clk *clk_reg_sysctrl(struct device *dev,
>         }
>
>         clk = devm_kzalloc(dev, sizeof(struct clk_sysctrl), GFP_KERNEL);
> -       if (!clk) {
> -               dev_err(dev, "clk_sysctrl: could not allocate clk\n");
> +       if (!clk)
>                 return ERR_PTR(-ENOMEM);
> -       }
>
>         /* set main clock registers */
>         clk->reg_sel[0] = reg_sel[0];
> --
> 2.14.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web