mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-samsung-soc@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Sangbeom Kim <sbkim73@samsung.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/2] regulator: s2mps11: Use kcalloc() in s2mps11_pmic_probe()
Date: Sat, 15 Apr 2017 12:48:45 +0200	[thread overview]
Message-ID: <20170415104845.bofxl34wr7z7khix@kozik-lap> (raw)
In-Reply-To: <542252e0-817f-ce13-fbd5-8fd8dda4c746@users.sourceforge.net>

On Fri, Apr 14, 2017 at 11:01:25PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 14 Apr 2017 22:00:35 +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 "kcalloc".
> 
> This issue was detected by using the Coccinelle software.

Unfortunately you write mostly cryptic commit messages. This does not
answer for the main question - why this change is needed. Code looks
okay, but you should explain in simple words why this is needed.

Best regards,
Krzysztof

> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/regulator/s2mps11.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
> index 7726b874e539..b4e588cce03d 100644
> --- a/drivers/regulator/s2mps11.c
> +++ b/drivers/regulator/s2mps11.c
> @@ -1162,7 +1162,7 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	rdata = kzalloc(sizeof(*rdata) * rdev_num, GFP_KERNEL);
> +	rdata = kcalloc(rdev_num, sizeof(*rdata), GFP_KERNEL);
>  	if (!rdata)
>  		return -ENOMEM;
>  
> -- 
> 2.12.2
> 

  reply	other threads:[~2017-04-15 10:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14 21:00 [PATCH 0/2] regulator: s2mps11: Fine-tuning for s2mps11_pmic_probe() SF Markus Elfring
2017-04-14 21:01 ` [PATCH 1/2] regulator: s2mps11: Use kcalloc() in s2mps11_pmic_probe() SF Markus Elfring
2017-04-15 10:48   ` Krzysztof Kozlowski [this message]
2017-04-15 17:29     ` SF Markus Elfring
2017-04-14 21:02 ` [PATCH 2/2] regulator: s2mps11: Use devm_kmalloc_array() " SF Markus Elfring

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=20170415104845.bofxl34wr7z7khix@kozik-lap \
    --to=krzk@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=sbkim73@samsung.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

all inboxes | Powered by JetHome®