* [PATCH] Staging: greybus: Prefer kcalloc over kzalloc
@ 2017-05-06 14:14 karthik
2017-05-08 10:35 ` Rui Miguel Silva
0 siblings, 1 reply; 4+ messages in thread
From: karthik @ 2017-05-06 14:14 UTC (permalink / raw)
To: rmfrfs, johan, elder, gregkh
Cc: greybus-dev, devel, linux-kernel, Karthik Tummala
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 arugment
in kzalloc, prefer kcalloc.
Signed-off-by: Karthik Tummala <karthik@techveda.org>
---
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;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Staging: greybus: Prefer kcalloc over kzalloc
2017-05-06 14:14 [PATCH] Staging: greybus: Prefer kcalloc over kzalloc karthik
@ 2017-05-08 10:35 ` Rui Miguel Silva
2017-05-08 12:35 ` [PATCH v2] Staging: greybus: light: " karthik
0 siblings, 1 reply; 4+ messages in thread
From: Rui Miguel Silva @ 2017-05-08 10:35 UTC (permalink / raw)
To: karthik; +Cc: johan, elder, gregkh, greybus-dev, devel, linux-kernel
Hi Karthik,
Thanks for the patch.
On Sat, May 06, 2017 at 07:44:10PM +0530, 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 arugment
>in kzalloc, prefer kcalloc.
>
>Signed-off-by: Karthik Tummala <karthik@techveda.org>
Can you send a v2 with a subject similar to the other commits in
the file. i.e, starting with staging: greybus: light: ...
And you have a typo in the change log s/arugment/argument/.
If this two are fixed, you can add my:
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Cheers,
Rui
>---
> 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;
>--
>1.9.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] Staging: greybus: light: Prefer kcalloc over kzalloc
2017-05-08 10:35 ` Rui Miguel Silva
@ 2017-05-08 12:35 ` karthik
2017-05-09 5:32 ` [greybus-dev] " Viresh Kumar
0 siblings, 1 reply; 4+ messages in thread
From: karthik @ 2017-05-08 12:35 UTC (permalink / raw)
To: rmfrfs, johan, elder, gregkh
Cc: greybus-dev, devel, linux-kernel, sunil.m, Karthik Tummala
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;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [greybus-dev] [PATCH v2] Staging: greybus: light: Prefer kcalloc over kzalloc
2017-05-08 12:35 ` [PATCH v2] Staging: greybus: light: " karthik
@ 2017-05-09 5:32 ` Viresh Kumar
0 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2017-05-09 5:32 UTC (permalink / raw)
To: karthik
Cc: rmfrfs, johan, elder, gregkh, devel, greybus-dev, sunil.m, linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-09 5:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-06 14:14 [PATCH] Staging: greybus: Prefer kcalloc over kzalloc 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 ` [greybus-dev] " Viresh Kumar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.