TI-SoC-thermal: Fine-tuning for two functions
Subsystems (3)
cover TI-SoC-thermal: Fine-tuning for two functions
From: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 17:24:56 +0200
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Use devm_kcalloc() in ti_bandgap_build()
Delete error messages for failed memory allocations in ti_bandgap_build() Fix a typo in a comment line
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
Signature · 1 line
2.12.2
PATCH 1/3 ti-soc-thermal: Use devm_kcalloc() in ti_bandgap_build()
From: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 16:45:25 +0200
A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc".
This issue was detected by using the Coccinelle software.
--- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/ti-soc-thermal/ti-bandgap.c +2 -2
@@ -1224,8 +1224,8 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) bgp->conf = of_id->data;/* register shadow for context save and restore */ - bgp->regval =devm_kzalloc (&pdev->dev,sizeof (*bgp->regval) * - bgp->conf->sensor_count,GFP_KERNEL ); + bgp->regval =devm_kcalloc (&pdev->dev, bgp->conf->sensor_count, +sizeof (*bgp->regval),GFP_KERNEL );if (!bgp->regval) {dev_err (&pdev->dev,"Unable to allocate mem for driver ref\n" );return ERR_PTR (-ENOMEM );
Signature · 1 line
2.12.2
Re: [PATCH 1/3] ti-soc-thermal: Use devm_kcalloc() in ti_bandgap_build()
Quoted 6 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 16:45:25 +0200A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "
devm_kcalloc".
Quoted 24 lines
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/thermal/ti-soc-thermal/ti-bandgap.c +2
-2@@ -1224,8 +1224,8 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) bgp->conf = of_id->data;/* register shadow for context save and restore */ - bgp->regval =devm_kzalloc (&pdev->dev,sizeof (*bgp->regval) * - bgp->conf->sensor_count,GFP_KERNEL ); + bgp->regval =devm_kcalloc (&pdev->dev, bgp->conf->sensor_count, +sizeof (*bgp->regval),GFP_KERNEL );if (!bgp->regval) {dev_err (&pdev->dev,"Unable to allocate mem for driver ref\n" );return ERR_PTR (-ENOMEM );
PATCH 2/3 ti-soc-thermal: Delete error messages for failed memory allocations in ti_bandgap_build()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 17:03:07 +0200
The script "checkpatch.pl" pointed information out like the following.
WARNING: Possible unnecessary 'out of memory' message
Thus remove such statements here.
--- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/thermal/ti-soc-thermal/ti-bandgap.c +2 -6
@@ -1217,7 +1217,5 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) -if (!bgp) { -dev_err (&pdev->dev,"Unable to allocate mem for driver ref\n" ); +if (!bgp)return ERR_PTR (-ENOMEM ); - } of_id =of_match_device (of_ti_bandgap_match, &pdev->dev);if (of_id)
@@ -1229,7 +1227,5 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) -if (!bgp->regval) { -dev_err (&pdev->dev,"Unable to allocate mem for driver ref\n" ); +if (!bgp->regval)return ERR_PTR (-ENOMEM ); - } i =0 ; do {
Signature · 1 line
2.12.2
Re: [PATCH 2/3] ti-soc-thermal: Delete error messages for failed memory allocations in ti_bandgap_build()
Quoted 8 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 17:03:07 +0200The script "checkpatch.pl" pointed information out like the following.
WARNING: Possible unnecessary 'out of memory' message
Thus remove such statements here.
Quoted 30 lines
Signed-off-by Markus Elfring <[email protected]>--- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/thermal/ti-soc-thermal/ti-bandgap.c +2
-6@@ -1217,7 +1217,5 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) -if (!bgp) { -dev_err (&pdev->dev,"Unable to allocate mem for driver ref\n" ); +if (!bgp)return ERR_PTR (-ENOMEM ); - } of_id =of_match_device (of_ti_bandgap_match, &pdev->dev);if (of_id)@@ -1229,7 +1227,5 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) -if (!bgp->regval) { -dev_err (&pdev->dev,"Unable to allocate mem for driver ref\n" ); +if (!bgp->regval)return ERR_PTR (-ENOMEM ); - } i =0 ; do {
PATCH 3/3 ti-soc-thermal: Fix a typo in a comment line
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 17:11:28 +0200
Add a missing character in this description for a function.
--- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/ti-soc-thermal/ti-bandgap.c +1 -1
@@ -1010,7 +1010,7 @@ ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id) }/** -* ti_bandgap_set_continous_mode() - One time enabling of continuous mode +* ti_bandgap_set_continuous_mode() - One time enabling of continuous mode * @bgp: pointer to struct ti_bandgap * * Call this function only if HAS(MODE_CONFIG) is set. As this driver may
Signature · 1 line
2.12.2
Re: [PATCH 3/3] ti-soc-thermal: Fix a typo in a comment line
Quoted 4 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 17:11:28 +0200Add a missing character in this description for a function.
Quoted 20 lines
Signed-off-by Markus Elfring <[email protected]>--- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/ti-soc-thermal/ti-bandgap.c +1
-1@@ -1010,7 +1010,7 @@ ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id) }/** -* ti_bandgap_set_continous_mode() - One time enabling of continuous mode +* ti_bandgap_set_continuous_mode() - One time enabling of continuous mode * @bgp: pointer to struct ti_bandgap * * Call this function only if HAS(MODE_CONFIG) is set. As this driver may
Eduardo Valentin
maintainerQuoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 17:24:56 +0200Three update suggestions were taken into account
from static source code analysis.Markus Elfring (3):
Usedevm_kcalloc()inti_bandgap_build()
Delete error messages for failed memory allocations inti_bandgap_build()Fix a typo in a comment line
Keerthy,
Can you please give it a shot of this series on all supported OMAP chip boards? I do not see any major issue with the series at all, but would like to get it tested by you.
BR,
Quoted 6 lines
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)Signature · 1 line
2.12.2
Keerthy
maintainerQuoted 13 lines · Eduardo Valentin
Quoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 17:24:56 +0200Three update suggestions were taken into account
from static source code analysis.Markus Elfring (3):
Usedevm_kcalloc()inti_bandgap_build()
Delete error messages for failed memory allocations inti_bandgap_build()Fix a typo in a comment line
Quoted 5 lines
Keerthy,
Can you please give it a shot of this series on all supported OMAP chip boards? I do not see any major issue with the series at all, but would like to get it tested by you.
Sure Eduardo. I will test and review this series.
Quoted 9 lines
BR,
Quoted 6 lines
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)Signature · 1 line
2.12.2
Quoted 16 lines · Keerthy
Quoted 13 lines · Eduardo Valentin
Quoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 26 Apr 2017 17:24:56 +0200Three update suggestions were taken into account
from static source code analysis.Markus Elfring (3):
Usedevm_kcalloc()inti_bandgap_build()
Delete error messages for failed memory allocations inti_bandgap_build()Fix a typo in a comment line
Quoted 7 lines
Quoted 5 lines
Keerthy,
Can you please give it a shot of this series on all supported OMAP chip boards? I do not see any major issue with the series at all, but would like to get it tested by you.
Sure Eduardo. I will test and review this series.
Tested for Temperatures of all the sensors and thermal shutdown triggering using emul_temp on DRA7/DRA72 AM57xx-evm boards.
For the series:
- Keerthy
Quoted 10 lines
Quoted 10 lines
BR,
Quoted 6 lines
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)Signature · 1 line
2.12.2