Skip to contentSkip to conversation

clk/tegra: Delete an error message for a failed memory allocation in three functions

PATCH Applied SF Markus Elfring 3 participants 3 messages Sep 27, 2017 – Nov 2, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk/tegra: Delete an error message for a failed memory allocation in three functions

From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 18:40:34 +0200

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

This issue was detected by using the Coccinelle software.

---
 drivers/clk/tegra/clk-audio-sync.c  | 4 +---
 drivers/clk/tegra/clk-divider.c     | 5 +----
 drivers/clk/tegra/clk-periph-gate.c | 4 +---
 3 files changed, 3 insertions(+), 10 deletions(-)
drivers/clk/tegra/clk-audio-sync.c +1 -3
index 92d04ce2dee6..62a84c883dd4 100644
@@ -62,10 +62,8 @@ struct clk *tegra_clk_register_sync_source(const char *name,
 	struct clk *clk;
 
 	sync = kzalloc(sizeof(*sync), GFP_KERNEL);
-	if (!sync) {
-		pr_err("%s: could not allocate sync source clk\n", __func__);
+	if (!sync)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	sync->rate = rate;
 	sync->max_rate = max_rate;
drivers/clk/tegra/clk-divider.c +1 -4
index 16e0aee14773..5ee9423ccac2 100644
@@ -156,11 +156,8 @@ struct clk *tegra_clk_register_divider(const char *name,
 	struct clk_init_data init;
 
 	divider = kzalloc(sizeof(*divider), GFP_KERNEL);
-	if (!divider) {
-		pr_err("%s: could not allocate fractional divider clk\n",
-		       __func__);
+	if (!divider)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	init.name = name;
 	init.ops = &tegra_clk_frac_div_ops;
drivers/clk/tegra/clk-periph-gate.c +1 -3
index 303ef32ee3f1..276cc4c59204 100644
@@ -141,10 +141,8 @@ struct clk *tegra_clk_register_periph_gate(const char *name,
 		return ERR_PTR(-EINVAL);
 
 	gate = kzalloc(sizeof(*gate), GFP_KERNEL);
-	if (!gate) {
-		pr_err("%s: could not allocate periph gate clk\n", __func__);
+	if (!gate)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	init.name = name;
 	init.flags = flags;
Signature · 1 line
2.14.2
Acked-by on v1 1/1
#1 lore raw
Quoted 70 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 18:40:34 +0200

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

This issue was detected by using the Coccinelle software.

---
 drivers/clk/tegra/clk-audio-sync.c  | 4 +---
 drivers/clk/tegra/clk-divider.c     | 5 +----
 drivers/clk/tegra/clk-periph-gate.c | 4 +---
 3 files changed, 3 insertions(+), 10 deletions(-)
drivers/clk/tegra/clk-audio-sync.c +1 -3
index 92d04ce2dee6..62a84c883dd4 100644
@@ -62,10 +62,8 @@ struct clk *tegra_clk_register_sync_source(const char *name,
 	struct clk *clk;
 
 	sync = kzalloc(sizeof(*sync), GFP_KERNEL);
-	if (!sync) {
-		pr_err("%s: could not allocate sync source clk\n", __func__);
+	if (!sync)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	sync->rate = rate;
 	sync->max_rate = max_rate;
drivers/clk/tegra/clk-divider.c +1 -4
index 16e0aee14773..5ee9423ccac2 100644
@@ -156,11 +156,8 @@ struct clk *tegra_clk_register_divider(const char *name,
 	struct clk_init_data init;
 
 	divider = kzalloc(sizeof(*divider), GFP_KERNEL);
-	if (!divider) {
-		pr_err("%s: could not allocate fractional divider clk\n",
-		       __func__);
+	if (!divider)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	init.name = name;
 	init.ops = &tegra_clk_frac_div_ops;
drivers/clk/tegra/clk-periph-gate.c +1 -3
index 303ef32ee3f1..276cc4c59204 100644
@@ -141,10 +141,8 @@ struct clk *tegra_clk_register_periph_gate(const char *name,
 		return ERR_PTR(-EINVAL);
 
 	gate = kzalloc(sizeof(*gate), GFP_KERNEL);
-	if (!gate) {
-		pr_err("%s: could not allocate periph gate clk\n", __func__);
+	if (!gate)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	init.name = name;
 	init.flags = flags;
Signature · 6 lines
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#2 lore raw
In reply to SF Markus Elfring
Quoted 9 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 18:40:34 +0200

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

This issue was detected by using the Coccinelle software.

---

Applied to clk-next

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project