Ux500 clock: Adjustments for three function implementations
Subsystems (3)
cover Ux500 clock: Adjustments for three function implementations
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 20:40:20 +0200
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Delete an error message for a failed memory allocation in three functions Improve a size determination in three functions
drivers/clk/ux500/clk-prcc.c | 6 ++---- drivers/clk/ux500/clk-prcmu.c | 6 ++---- drivers/clk/ux500/clk-sysctrl.c | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-)
Signature · 1 line
2.14.2
PATCH 1/2 clk/ux500: Delete an error message for a failed memory allocation in three functions
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 20:23:58 +0200
Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
--- drivers/clk/ux500/clk-prcc.c | 4 +--- drivers/clk/ux500/clk-prcmu.c | 4 +--- drivers/clk/ux500/clk-sysctrl.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-)
drivers/clk/ux500/clk-prcc.c +1 -3
@@ -108,10 +108,8 @@ static struct clk *clk_reg_prcc(const char *name, } clk =kzalloc (sizeof (struct clk_prcc ),GFP_KERNEL ); -if (!clk) { -pr_err ("clk_prcc: %s could not allocate clk\n" , __func__); +if (!clk)return ERR_PTR (-ENOMEM ); - } clk->base =ioremap (phy_base,SZ_4K );if (!clk->base)
drivers/clk/ux500/clk-prcmu.c +1 -3
@@ -259,10 +259,8 @@ static struct clk *clk_reg_prcmu(const char *name, } clk =kzalloc (sizeof (struct clk_prcmu ),GFP_KERNEL ); -if (!clk) { -pr_err ("clk_prcmu: %s could not allocate clk\n" , __func__); +if (!clk)return ERR_PTR (-ENOMEM ); - } clk->cg_sel = cg_sel; clk->is_prepared =1 ;
drivers/clk/ux500/clk-sysctrl.c +1 -3
@@ -140,10 +140,8 @@ static struct clk *clk_reg_sysctrl(struct device *dev, } clk =devm_kzalloc (dev,sizeof (struct clk_sysctrl ),GFP_KERNEL ); -if (!clk) { -dev_err (dev,"clk_sysctrl: could not allocate clk\n" ); +if (!clk)return ERR_PTR (-ENOMEM ); - }/* set main clock registers */ clk->reg_sel[0 ] = reg_sel[0 ];
Signature · 1 line
2.14.2
Re: [PATCH 1/2] clk/ux500: Delete an error message for a failed memory allocation in three functions
Quoted 8 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 20:23:58 +0200Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
Quoted 62 lines
--- drivers/clk/ux500/clk-prcc.c | 4 +--- drivers/clk/ux500/clk-prcmu.c | 4 +--- drivers/clk/ux500/clk-sysctrl.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-)drivers/clk/ux500/clk-prcc.c +1
-3@@ -108,10 +108,8 @@ static struct clk *clk_reg_prcc(const char *name, } clk =kzalloc (sizeof (struct clk_prcc ),GFP_KERNEL ); -if (!clk) { -pr_err ("clk_prcc: %s could not allocate clk\n" , __func__); +if (!clk)return ERR_PTR (-ENOMEM ); - } clk->base =ioremap (phy_base,SZ_4K );if (!clk->base)drivers/clk/ux500/clk-prcmu.c +1
-3@@ -259,10 +259,8 @@ static struct clk *clk_reg_prcmu(const char *name, } clk =kzalloc (sizeof (struct clk_prcmu ),GFP_KERNEL ); -if (!clk) { -pr_err ("clk_prcmu: %s could not allocate clk\n" , __func__); +if (!clk)return ERR_PTR (-ENOMEM ); - } clk->cg_sel = cg_sel; clk->is_prepared =1 ;drivers/clk/ux500/clk-sysctrl.c +1
-4@@ -140,10 +140,8 @@ static struct clk *clk_reg_sysctrl(struct device *dev, } clk =devm_kzalloc (dev,sizeof (struct clk_sysctrl ),GFP_KERNEL ); -if (!clk) { -dev_err (dev,"clk_sysctrl: could not allocate clk\n" ); +if (!clk)return ERR_PTR (-ENOMEM ); - }/* set main clock registers */ clk->reg_sel[0 ] = reg_sel[0 ]; --2.14.2
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Stephen Boyd
AppliedRe: [PATCH 1/2] clk/ux500: Delete an error message for a failed memory allocation in three functions
In reply to SF Markus ElfringQuoted 9 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 20:23:58 +0200Omit extra messages for a memory allocation failure in these functions.
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
PATCH 2/2 clk/ux500: Improve a size determination in three functions
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 20:30:53 +0200
Replace the specification of data structures by pointer dereferences 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/ux500/clk-prcc.c | 2 +- drivers/clk/ux500/clk-prcmu.c | 2 +- drivers/clk/ux500/clk-sysctrl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/clk/ux500/clk-prcc.c +1 -1
@@ -107,7 +107,7 @@ static struct clk *clk_reg_prcc(const char *name,return ERR_PTR (-EINVAL ); } - clk =kzalloc (sizeof (struct clk_prcc ),GFP_KERNEL ); + clk =kzalloc (sizeof (*clk),GFP_KERNEL );if (!clk)return ERR_PTR (-ENOMEM );
drivers/clk/ux500/clk-prcmu.c +1 -1
@@ -258,7 +258,7 @@ static struct clk *clk_reg_prcmu(const char *name,return ERR_PTR (-EINVAL ); } - clk =kzalloc (sizeof (struct clk_prcmu ),GFP_KERNEL ); + clk =kzalloc (sizeof (*clk),GFP_KERNEL );if (!clk)return ERR_PTR (-ENOMEM );
drivers/clk/ux500/clk-sysctrl.c +1 -1
@@ -139,7 +139,7 @@ static struct clk *clk_reg_sysctrl(struct device *dev,return ERR_PTR (-EINVAL ); } - clk =devm_kzalloc (dev,sizeof (struct clk_sysctrl ),GFP_KERNEL ); + clk =devm_kzalloc (dev,sizeof (*clk),GFP_KERNEL );if (!clk)return ERR_PTR (-ENOMEM );
Signature · 1 line
2.14.2
Re: [PATCH 2/2] clk/ux500: Improve a size determination in three functions
Quoted 10 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 20:30:53 +0200Replace the specification of data structures by pointer dereferences 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]>
Quoted 53 lines
--- drivers/clk/ux500/clk-prcc.c | 2 +- drivers/clk/ux500/clk-prcmu.c | 2 +- drivers/clk/ux500/clk-sysctrl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)drivers/clk/ux500/clk-prcc.c +1
-1@@ -107,7 +107,7 @@ static struct clk *clk_reg_prcc(const char *name,return ERR_PTR (-EINVAL ); } - clk =kzalloc (sizeof (struct clk_prcc ),GFP_KERNEL ); + clk =kzalloc (sizeof (*clk),GFP_KERNEL );if (!clk)return ERR_PTR (-ENOMEM );drivers/clk/ux500/clk-prcmu.c +1
-1@@ -258,7 +258,7 @@ static struct clk *clk_reg_prcmu(const char *name,return ERR_PTR (-EINVAL ); } - clk =kzalloc (sizeof (struct clk_prcmu ),GFP_KERNEL ); + clk =kzalloc (sizeof (*clk),GFP_KERNEL );if (!clk)return ERR_PTR (-ENOMEM );drivers/clk/ux500/clk-sysctrl.c +1
-2@@ -139,7 +139,7 @@ static struct clk *clk_reg_sysctrl(struct device *dev,return ERR_PTR (-EINVAL ); } - clk =devm_kzalloc (dev,sizeof (struct clk_sysctrl ),GFP_KERNEL ); + clk =devm_kzalloc (dev,sizeof (*clk),GFP_KERNEL );if (!clk)return ERR_PTR (-ENOMEM ); --2.14.2
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Stephen Boyd
AppliedRe: [PATCH 2/2] clk/ux500: Improve a size determination in three functions
In reply to SF Markus ElfringQuoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 27 Sep 2017 20:30:53 +0200Replace the specification of data structures by pointer dereferences 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