Skip to contentSkip to conversation

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

PATCH Applied SF Markus Elfring 3 participants 3 messages Sep 26, 2017 – Nov 11, 2017

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

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

From: Markus Elfring <[email protected]>
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.

---
 drivers/clk/hisilicon/clkgate-separated.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/clk/hisilicon/clkgate-separated.c +1 -3
index 7908bc3c9ec7..f028bcffe12c 100644
@@ -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;
Signature · 1 line
2.14.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Markus,

Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
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.

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

Quoted 23 lines
---
 drivers/clk/hisilicon/clkgate-separated.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/clk/hisilicon/clkgate-separated.c +1 -3
index 7908bc3c9ec7..f028bcffe12c 100644
@@ -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;
Signature · 1 line
2.14.1
Applied
#2 lore raw
In reply to SF Markus Elfring
Quoted 9 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
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.

---

Applied to clk-next

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