versatile clock: Adjustments for icst_clk_setup()
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
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
@@ -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
PATCH 2/2 clk/versatile: Improve a size determination in icst_clk_setup()
In reply to SF Markus ElfringFrom: 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
@@ -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
Re: [PATCH 1/2] clk/versatile: Delete two error messages for a failed memory allocation in icst_clk_setup()
In reply to SF Markus ElfringQuoted 8 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:21:23 +0200Omit extra messages for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
Yours,
Linus Walleij
Re: [PATCH 2/2] clk/versatile: Improve a size determination in icst_clk_setup()
In reply to SF Markus ElfringQuoted 10 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:24:43 +0200Replace 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.
Signed-off-by Markus Elfring <[email protected]>
Yours,
Linus Walleij
Stephen Boyd
AppliedRe: [PATCH 2/2] clk/versatile: Improve a size determination in icst_clk_setup()
In reply to SF Markus ElfringQuoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:24:43 +0200Replace 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.
Signed-off-by Markus Elfring <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Stephen Boyd
AppliedRe: [PATCH 1/2] clk/versatile: Delete two error messages for a failed memory allocation in icst_clk_setup()
In reply to SF Markus ElfringQuoted 9 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 21:21:23 +0200Omit extra messages for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project