Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1631536 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-04-26 17:40 +0200 |
| Last post | 2017-05-02 07:00 +0200 |
| Articles | 10 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/3] TI-SoC-thermal: Fine-tuning for two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-26 17:40 +0200
[PATCH 1/3] ti-soc-thermal: Use devm_kcalloc() in ti_bandgap_build() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-26 17:40 +0200
Re: [PATCH 1/3] ti-soc-thermal: Use devm_kcalloc() in ti_bandgap_build() Keerthy <j-keerthy@ti.com> - 2017-05-02 06:00 +0200
[PATCH 2/3] ti-soc-thermal: Delete error messages for failed memory allocations in ti_bandgap_build() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-26 17:50 +0200
Re: [PATCH 2/3] ti-soc-thermal: Delete error messages for failed memory allocations in ti_bandgap_build() Keerthy <j-keerthy@ti.com> - 2017-05-02 06:00 +0200
[PATCH 3/3] ti-soc-thermal: Fix a typo in a comment line SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-26 17:50 +0200
Re: [PATCH 3/3] ti-soc-thermal: Fix a typo in a comment line Keerthy <j-keerthy@ti.com> - 2017-05-02 06:00 +0200
Re: [PATCH 0/3] TI-SoC-thermal: Fine-tuning for two functions Eduardo Valentin <edubezval@gmail.com> - 2017-04-27 18:30 +0200
Re: [PATCH 0/3] TI-SoC-thermal: Fine-tuning for two functions Keerthy <j-keerthy@ti.com> - 2017-05-01 07:30 +0200
Re: [PATCH 0/3] TI-SoC-thermal: Fine-tuning for two functions Keerthy <j-keerthy@ti.com> - 2017-05-02 07:00 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-04-26 17:40 +0200 |
| Subject | [PATCH 0/3] TI-SoC-thermal: Fine-tuning for two functions |
| Message-ID | <tAxcS-4ap-21@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> 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(-) -- 2.12.2
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-04-26 17:40 +0200 |
| Subject | [PATCH 1/3] ti-soc-thermal: Use devm_kcalloc() in ti_bandgap_build() |
| Message-ID | <tAxcS-4ap-27@gated-at.bofh.it> |
| In reply to | #1631536 |
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index ba9c302454fb..f19cb7612a65 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -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);
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Keerthy <j-keerthy@ti.com> |
|---|---|
| Date | 2017-05-02 06:00 +0200 |
| Subject | Re: [PATCH 1/3] ti-soc-thermal: Use devm_kcalloc() in ti_bandgap_build() |
| Message-ID | <tCx8K-14U-1@gated-at.bofh.it> |
| In reply to | #1631537 |
On Wednesday 26 April 2017 09:04 PM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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".
Reviewed-by: Keerthy <j-keerthy@ti.com>
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/thermal/ti-soc-thermal/ti-bandgap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> index ba9c302454fb..f19cb7612a65 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> @@ -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);
>
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-04-26 17:50 +0200 |
| Subject | [PATCH 2/3] ti-soc-thermal: Delete error messages for failed memory allocations in ti_bandgap_build() |
| Message-ID | <tAxmx-4e9-11@gated-at.bofh.it> |
| In reply to | #1631536 |
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index f19cb7612a65..109fb0a5f19f 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -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 {
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Keerthy <j-keerthy@ti.com> |
|---|---|
| Date | 2017-05-02 06:00 +0200 |
| Subject | Re: [PATCH 2/3] ti-soc-thermal: Delete error messages for failed memory allocations in ti_bandgap_build() |
| Message-ID | <tCx8K-14U-5@gated-at.bofh.it> |
| In reply to | #1631540 |
On Wednesday 26 April 2017 09:07 PM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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.
Reviewed-by: Keerthy <j-keerthy@ti.com>
>
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/thermal/ti-soc-thermal/ti-bandgap.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> index f19cb7612a65..109fb0a5f19f 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> @@ -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 {
>
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-04-26 17:50 +0200 |
| Subject | [PATCH 3/3] ti-soc-thermal: Fix a typo in a comment line |
| Message-ID | <tAxmy-4e9-33@gated-at.bofh.it> |
| In reply to | #1631536 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 26 Apr 2017 17:11:28 +0200 Add a missing character in this description for a function. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index 109fb0a5f19f..696ab3046b87 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c @@ -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 -- 2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Keerthy <j-keerthy@ti.com> |
|---|---|
| Date | 2017-05-02 06:00 +0200 |
| Subject | Re: [PATCH 3/3] ti-soc-thermal: Fix a typo in a comment line |
| Message-ID | <tCx8K-14U-3@gated-at.bofh.it> |
| In reply to | #1631552 |
On Wednesday 26 April 2017 09:09 PM, SF Markus Elfring wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Wed, 26 Apr 2017 17:11:28 +0200 > > Add a missing character in this description for a function. Reviewed-by: Keerthy <j-keerthy@ti.com> > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> > --- > drivers/thermal/ti-soc-thermal/ti-bandgap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c > index 109fb0a5f19f..696ab3046b87 100644 > --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c > +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c > @@ -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 >
[toc] | [prev] | [next] | [standalone]
| From | Eduardo Valentin <edubezval@gmail.com> |
|---|---|
| Date | 2017-04-27 18:30 +0200 |
| Message-ID | <tAUsN-36Q-15@gated-at.bofh.it> |
| In reply to | #1631536 |
[Multipart message — attachments visible in raw view] — view raw
On Wed, Apr 26, 2017 at 05:33:10PM +0200, SF Markus Elfring wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > 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 > 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, > drivers/thermal/ti-soc-thermal/ti-bandgap.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > > -- > 2.12.2 >
[toc] | [prev] | [next] | [standalone]
| From | Keerthy <j-keerthy@ti.com> |
|---|---|
| Date | 2017-05-01 07:30 +0200 |
| Message-ID | <tCc4h-4U0-3@gated-at.bofh.it> |
| In reply to | #1632240 |
On Thursday 27 April 2017 09:50 PM, Eduardo Valentin wrote: > On Wed, Apr 26, 2017 at 05:33:10PM +0200, SF Markus Elfring wrote: >> From: Markus Elfring <elfring@users.sourceforge.net> >> 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 >> > > 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. > > BR, > >> drivers/thermal/ti-soc-thermal/ti-bandgap.c | 14 +++++--------- >> 1 file changed, 5 insertions(+), 9 deletions(-) >> >> -- >> 2.12.2 >>
[toc] | [prev] | [next] | [standalone]
| From | Keerthy <j-keerthy@ti.com> |
|---|---|
| Date | 2017-05-02 07:00 +0200 |
| Message-ID | <tCy4N-1Fx-1@gated-at.bofh.it> |
| In reply to | #1633549 |
On Monday 01 May 2017 10:50 AM, Keerthy wrote: > > > On Thursday 27 April 2017 09:50 PM, Eduardo Valentin wrote: >> On Wed, Apr 26, 2017 at 05:33:10PM +0200, SF Markus Elfring wrote: >>> From: Markus Elfring <elfring@users.sourceforge.net> >>> 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 >>> >> >> 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: Acked-by: Keerthy <j-keerthy@ti.com> Tested-by: Keerthy <j-keerthy@ti.com> - Keerthy > >> >> BR, >> >>> drivers/thermal/ti-soc-thermal/ti-bandgap.c | 14 +++++--------- >>> 1 file changed, 5 insertions(+), 9 deletions(-) >>> >>> -- >>> 2.12.2 >>>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web