Skip to contentSkip to conversation

bus: ti-sysc: Use 2-factor allocator calls

PATCH In review Kees Cook 2 participants 2 messages Jul 4, 2018 – Jul 5, 2018 OMAP2+ support

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 bus: ti-sysc: Use 2-factor allocator calls

As done treewide already, switch from open-coded multiplication to the 2-factor allocation helpers.

---
 drivers/bus/ti-sysc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/bus/ti-sysc.c +4 -4
index 1cc29629d238..80d60f43db56 100644
@@ -169,9 +169,9 @@ static int sysc_get_clocks(struct sysc *ddata)
 	const char *name;
 	int nr_fck = 0, nr_ick = 0, i, error = 0;
 
-	ddata->clock_roles = devm_kzalloc(ddata->dev,
-					  sizeof(*ddata->clock_roles) *
+	ddata->clock_roles = devm_kcalloc(ddata->dev,
 					  SYSC_MAX_CLOCKS,
+					  sizeof(*ddata->clock_roles),
 					  GFP_KERNEL);
 	if (!ddata->clock_roles)
 		return -ENOMEM;
@@ -200,8 +200,8 @@ static int sysc_get_clocks(struct sysc *ddata)
 		return -EINVAL;
 	}
 
-	ddata->clocks = devm_kzalloc(ddata->dev,
-				     sizeof(*ddata->clocks) * ddata->nr_clocks,
+	ddata->clocks = devm_kcalloc(ddata->dev,
+				     ddata->nr_clocks, sizeof(*ddata->clocks),
 				     GFP_KERNEL);
 	if (!ddata->clocks)
 		return -ENOMEM;
Signature · 6 lines
2.17.1


-- 
Kees Cook
Pixel Security
maintainer
#1 lore raw

Hi,

Quoted 2 lines · Kees Cook

As done treewide already, switch from open-coded multiplication to the 2-factor allocation helpers.

I just sent a pull request for your previous version of this patch with you in Cc.

Regards,

Tony