From: Viresh Kumar <viresh.kumar@linaro.org>
To: karthik@techveda.org
Cc: rmfrfs@gmail.com, johan@kernel.org, elder@kernel.org,
gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
greybus-dev@lists.linaro.org, sunil.m@techveda.org,
linux-kernel@vger.kernel.org
Subject: Re: [greybus-dev] [PATCH v2] Staging: greybus: light: Prefer kcalloc over kzalloc
Date: Tue, 9 May 2017 11:02:55 +0530 [thread overview]
Message-ID: <20170509053255.GA17481@vireshk-i7> (raw)
In-Reply-To: <1494246955-14245-1-git-send-email-karthik@techveda.org>
On 08-05-17, 18:05, karthik@techveda.org wrote:
> From: Karthik Tummala <karthik@techveda.org>
>
> Fixed following checkpatch.pl warning:
> * WARNING: Prefer kcalloc over kzalloc with multiply
>
> Instead of specifying no.of bytes * size as argument
> in kzalloc, prefer kcalloc.
>
> Signed-off-by: Karthik Tummala <karthik@techveda.org>
> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
> ---
> Changes for v2:
> - Changed subject line & fixed typo as suggested by
> Rui Miguel Silva
> ---
> drivers/staging/greybus/light.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
> index 1681362..861a249 100644
> --- a/drivers/staging/greybus/light.c
> +++ b/drivers/staging/greybus/light.c
> @@ -1030,7 +1030,7 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id)
> light->channels_count = conf.channel_count;
> light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL);
>
> - light->channels = kzalloc(light->channels_count *
> + light->channels = kcalloc(light->channels_count,
> sizeof(struct gb_channel), GFP_KERNEL);
> if (!light->channels)
> return -ENOMEM;
> @@ -1167,7 +1167,7 @@ static int gb_lights_create_all(struct gb_lights *glights)
> if (ret < 0)
> goto out;
>
> - glights->lights = kzalloc(glights->lights_count *
> + glights->lights = kcalloc(glights->lights_count,
> sizeof(struct gb_light), GFP_KERNEL);
> if (!glights->lights) {
> ret = -ENOMEM;
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
prev parent reply other threads:[~2017-05-09 5:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-06 14:14 [PATCH] Staging: greybus: " karthik
2017-05-08 10:35 ` Rui Miguel Silva
2017-05-08 12:35 ` [PATCH v2] Staging: greybus: light: " karthik
2017-05-09 5:32 ` Viresh Kumar [this message]
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=20170509053255.GA17481@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=devel@driverdev.osuosl.org \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=karthik@techveda.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmfrfs@gmail.com \
--cc=sunil.m@techveda.org \
/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®