Skip to contentSkip to conversation

staging: greybus: power_supply: replace kzalloc by kcalloc

PATCH In review JB Van Puyvelde 3 participants 3 messages May 11, 2017 – May 12, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: greybus: power_supply: replace kzalloc by kcalloc

According to checkpatch.pl, kcalloc should be preferred to kzalloc with multiply.

---
 drivers/staging/greybus/power_supply.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/power_supply.c +1 -1
index e85c988b7034..20cac20518d7 100644
@@ -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);
 
Signature · 1 line
2.11.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi JB,
Great! thanks for the patch,

Quoted 4 lines · JB Van Puyvelde

According to checkpatch.pl, kcalloc should be preferred to kzalloc with multiply.

Cheers,
Rui

Quoted 20 lines

---
drivers/staging/greybus/power_supply.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/power_supply.c +1 -1
index e85c988b7034..20cac20518d7 100644
@@ -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);
 
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#2 lore raw
In reply to JB Van Puyvelde
Quoted 7 lines · JB Van Puyvelde

According to checkpatch.pl, kcalloc should be preferred to kzalloc with multiply.

---
 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.

Quoted 21 lines
drivers/staging/greybus/power_supply.c +1 -1
index e85c988b7034..20cac20518d7 100644
@@ -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);
 
Signature · 6 lines
2.11.0

_______________________________________________
greybus-dev mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/greybus-dev
Signature · 1 line
viresh