* [PATCH] staging: greybus: power_supply: replace kzalloc by kcalloc
@ 2017-05-11 20:58 JB Van Puyvelde
2017-05-11 21:23 ` Rui Miguel Silva
2017-05-12 5:39 ` [greybus-dev] " Viresh Kumar
0 siblings, 2 replies; 3+ messages in thread
From: JB Van Puyvelde @ 2017-05-11 20:58 UTC (permalink / raw)
To: rmfrfs
Cc: johan, elder, gregkh, greybus-dev, devel, linux-kernel, JB Van Puyvelde
According to checkpatch.pl, kcalloc should be preferred to kzalloc with
multiply.
Signed-off-by: JB Van Puyvelde <jbvanpuyvelde@gmail.com>
---
drivers/staging/greybus/power_supply.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c
index e85c988b7034..20cac20518d7 100644
--- a/drivers/staging/greybus/power_supply.c
+++ b/drivers/staging/greybus/power_supply.c
@@ -944,7 +944,7 @@ static int gb_power_supplies_setup(struct gb_power_supplies *supplies)
if (ret < 0)
goto out;
- supplies->supply = kzalloc(supplies->supplies_count *
+ supplies->supply = kcalloc(supplies->supplies_count,
sizeof(struct gb_power_supply),
GFP_KERNEL);
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: greybus: power_supply: replace kzalloc by kcalloc
2017-05-11 20:58 [PATCH] staging: greybus: power_supply: replace kzalloc by kcalloc JB Van Puyvelde
@ 2017-05-11 21:23 ` Rui Miguel Silva
2017-05-12 5:39 ` [greybus-dev] " Viresh Kumar
1 sibling, 0 replies; 3+ messages in thread
From: Rui Miguel Silva @ 2017-05-11 21:23 UTC (permalink / raw)
To: JB Van Puyvelde; +Cc: johan, elder, gregkh, greybus-dev, devel, linux-kernel
Hi JB,
Great! thanks for the patch,
On Thu, May 11, 2017 at 10:58:56PM +0200, JB Van Puyvelde wrote:
>According to checkpatch.pl, kcalloc should be preferred to kzalloc with
>multiply.
>
>Signed-off-by: JB Van Puyvelde <jbvanpuyvelde@gmail.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Cheers,
Rui
>---
> drivers/staging/greybus/power_supply.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c
>index e85c988b7034..20cac20518d7 100644
>--- a/drivers/staging/greybus/power_supply.c
>+++ b/drivers/staging/greybus/power_supply.c
>@@ -944,7 +944,7 @@ static int gb_power_supplies_setup(struct gb_power_supplies *supplies)
> if (ret < 0)
> goto out;
>
>- supplies->supply = kzalloc(supplies->supplies_count *
>+ supplies->supply = kcalloc(supplies->supplies_count,
> sizeof(struct gb_power_supply),
> GFP_KERNEL);
>
>--
>2.11.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [greybus-dev] [PATCH] staging: greybus: power_supply: replace kzalloc by kcalloc
2017-05-11 20:58 [PATCH] staging: greybus: power_supply: replace kzalloc by kcalloc JB Van Puyvelde
2017-05-11 21:23 ` Rui Miguel Silva
@ 2017-05-12 5:39 ` Viresh Kumar
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2017-05-12 5:39 UTC (permalink / raw)
To: JB Van Puyvelde; +Cc: rmfrfs, devel, elder, johan, linux-kernel, greybus-dev
On 11-05-17, 22:58, JB Van Puyvelde wrote:
> According to checkpatch.pl, kcalloc should be preferred to kzalloc with
> multiply.
>
> Signed-off-by: JB Van Puyvelde <jbvanpuyvelde@gmail.com>
> ---
> drivers/staging/greybus/power_supply.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
You should have kept my Ack in this patch, as I have already given it earlier.
Anyway, here it is again.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c
> index e85c988b7034..20cac20518d7 100644
> --- a/drivers/staging/greybus/power_supply.c
> +++ b/drivers/staging/greybus/power_supply.c
> @@ -944,7 +944,7 @@ static int gb_power_supplies_setup(struct gb_power_supplies *supplies)
> if (ret < 0)
> goto out;
>
> - supplies->supply = kzalloc(supplies->supplies_count *
> + supplies->supply = kcalloc(supplies->supplies_count,
> sizeof(struct gb_power_supply),
> GFP_KERNEL);
>
> --
> 2.11.0
>
> _______________________________________________
> greybus-dev mailing list
> greybus-dev@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/greybus-dev
--
viresh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-12 5:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-11 20:58 [PATCH] staging: greybus: power_supply: replace kzalloc by kcalloc JB Van Puyvelde
2017-05-11 21:23 ` Rui Miguel Silva
2017-05-12 5:39 ` [greybus-dev] " Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).