public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Keerthy <j-keerthy@ti.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
	linux-pm@vger.kernel.org, linux-omap@vger.kernel.org,
	Eduardo Valentin <edubezval@gmail.com>,
	Zhang Rui <rui.zhang@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/3] ti-soc-thermal: Use devm_kcalloc() in ti_bandgap_build()
Date: Tue, 2 May 2017 09:25:56 +0530	[thread overview]
Message-ID: <baec64c7-2cae-dfd8-2f5e-790b2141efc9@ti.com> (raw)
In-Reply-To: <071d2e92-0bcc-5ccc-ad28-b05a72538d6b@users.sourceforge.net>



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);
> 

  reply	other threads:[~2017-05-02  3:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26 15:33 [PATCH 0/3] TI-SoC-thermal: Fine-tuning for two functions SF Markus Elfring
2017-04-26 15:34 ` [PATCH 1/3] ti-soc-thermal: Use devm_kcalloc() in ti_bandgap_build() SF Markus Elfring
2017-05-02  3:55   ` Keerthy [this message]
2017-04-26 15:37 ` [PATCH 2/3] ti-soc-thermal: Delete error messages for failed memory allocations " SF Markus Elfring
2017-05-02  3:52   ` Keerthy
2017-04-26 15:39 ` [PATCH 3/3] ti-soc-thermal: Fix a typo in a comment line SF Markus Elfring
2017-05-02  3:51   ` Keerthy
2017-04-27 16:20 ` [PATCH 0/3] TI-SoC-thermal: Fine-tuning for two functions Eduardo Valentin
2017-05-01  5:20   ` Keerthy
2017-05-02  4:55     ` Keerthy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=baec64c7-2cae-dfd8-2f5e-790b2141efc9@ti.com \
    --to=j-keerthy@ti.com \
    --cc=edubezval@gmail.com \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox