Skip to contentSkip to conversation

cpufreq: qoriq: Delete two error messages for a failed memory allocation in qoriq_cpufreq_cpu_init()

PATCH In review SF Markus Elfring 2 participants 2 messages Feb 15, 2018 – Feb 19, 2018

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

PATCH 1/1 cpufreq: qoriq: Delete two error messages for a failed memory allocation in qoriq_cpufreq_cpu_init()

From: Markus Elfring <[email protected]>
Date: Thu, 15 Feb 2018 18:00:37 +0100

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/cpufreq/qoriq-cpufreq.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/cpufreq/qoriq-cpufreq.c +2 -6
index 0562761a3dec..ee3e3656485b 100644
@@ -192,16 +192,12 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	count = clk_hw_get_num_parents(hwclk);
 
 	data->pclk = kcalloc(count, sizeof(struct clk *), GFP_KERNEL);
-	if (!data->pclk) {
-		pr_err("%s: no memory\n", __func__);
+	if (!data->pclk)
 		goto err_nomem2;
-	}
 
 	table = kcalloc(count + 1, sizeof(*table), GFP_KERNEL);
-	if (!table) {
-		pr_err("%s: no memory\n", __func__);
+	if (!table)
 		goto err_pclk;
-	}
 
 	for (i = 0; i < count; i++) {
 		clk = clk_hw_get_parent_by_index(hwclk, i)->clk;
Signature · 1 line
2.16.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Thu, 15 Feb 2018 18:00:37 +0100

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/cpufreq/qoriq-cpufreq.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/cpufreq/qoriq-cpufreq.c +1 -3
index 0562761a3dec..ee3e3656485b 100644
@@ -192,16 +192,12 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	count = clk_hw_get_num_parents(hwclk);
 
 	data->pclk = kcalloc(count, sizeof(struct clk *), GFP_KERNEL);
-	if (!data->pclk) {
-		pr_err("%s: no memory\n", __func__);
+	if (!data->pclk)
 		goto err_nomem2;
-	}

drivers/cpufreq/qoriq-cpufreq.c static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy) · line 203

Quoted 10 lines
drivers/cpufreq/qoriq-cpufreq.c +1 -3
 
 	table = kcalloc(count + 1, sizeof(*table), GFP_KERNEL);
-	if (!table) {
-		pr_err("%s: no memory\n", __func__);
+	if (!table)
 		goto err_pclk;
-	}
 
 	for (i = 0; i < count; i++) {
 		clk = clk_hw_get_parent_by_index(hwclk, i)->clk;
Signature · 1 line
viresh