Skip to contentSkip to conversation

versatile clock: Adjustments for icst_clk_setup()

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

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

cover versatile clock: Adjustments for icst_clk_setup()

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

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
Delete two error messages for a failed memory allocation Improve a size determination

 drivers/clk/versatile/clk-icst.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Signature · 1 line
2.14.2
#1 lore raw

PATCH 1/2 clk/versatile: Delete two error messages for a failed memory allocation in icst_clk_setup()

From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:21:23 +0200

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

This issue was detected by using the Coccinelle software.

---
 drivers/clk/versatile/clk-icst.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/clk/versatile/clk-icst.c +1 -4
index 09fbe66f1f11..20ab4ceffb28 100644
@@ -360,15 +360,12 @@ static struct clk *icst_clk_setup(struct device *dev,
 	struct icst_params *pclone;
 
 	icst = kzalloc(sizeof(struct clk_icst), GFP_KERNEL);
-	if (!icst) {
-		pr_err("could not allocate ICST clock!\n");
+	if (!icst)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	pclone = kmemdup(desc->params, sizeof(*pclone), GFP_KERNEL);
 	if (!pclone) {
 		kfree(icst);
-		pr_err("could not clone ICST params\n");
 		return ERR_PTR(-ENOMEM);
 	}
 
Signature · 1 line
2.14.2
#4 lore raw

PATCH 2/2 clk/versatile: Improve a size determination in icst_clk_setup()

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:24:43 +0200

Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

---
 drivers/clk/versatile/clk-icst.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/versatile/clk-icst.c +1 -1
index 20ab4ceffb28..dafe7a45875d 100644
@@ -359,7 +359,7 @@ static struct clk *icst_clk_setup(struct device *dev,
 	struct clk_init_data init;
 	struct icst_params *pclone;
 
-	icst = kzalloc(sizeof(struct clk_icst), GFP_KERNEL);
+	icst = kzalloc(sizeof(*icst), GFP_KERNEL);
 	if (!icst)
 		return ERR_PTR(-ENOMEM);
 
Signature · 1 line
2.14.2
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] clk/versatile: Delete two error messages for a failed memory allocation in icst_clk_setup()

In reply to SF Markus Elfring
Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:21:23 +0200

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

This issue was detected by using the Coccinelle software.

Yours,
Linus Walleij

Acked-by on v1 2/2
#5 lore raw

Re: [PATCH 2/2] clk/versatile: Improve a size determination in icst_clk_setup()

In reply to SF Markus Elfring
Quoted 10 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:24:43 +0200

Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Yours,
Linus Walleij

Applied
#6 lore raw

Re: [PATCH 2/2] clk/versatile: Improve a size determination in icst_clk_setup()

In reply to SF Markus Elfring
Quoted 11 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:24:43 +0200

Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention.

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
Applied
#3 lore raw

Re: [PATCH 1/2] clk/versatile: Delete two error messages for a failed memory allocation in icst_clk_setup()

In reply to SF Markus Elfring
Quoted 9 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:21:23 +0200

Omit extra messages 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