* [PATCH] bus: ti-sysc: Use 2-factor allocator calls
@ 2018-07-04 17:26 Kees Cook
2018-07-05 8:52 ` Tony Lindgren
0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2018-07-04 17:26 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-kernel
As done treewide already, switch from open-coded multiplication to the
2-factor allocation helpers.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
drivers/bus/ti-sysc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 1cc29629d238..80d60f43db56 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -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;
--
2.17.1
--
Kees Cook
Pixel Security
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-05 8:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-04 17:26 [PATCH] bus: ti-sysc: Use 2-factor allocator calls Kees Cook
2018-07-05 8:52 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox