diff options
author | Thierry Reding <treding@nvidia.com> | 2016-06-23 05:24:59 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2016-06-23 05:59:28 -0400 |
commit | b47a04919680185c3bdaa8f8d832addd38172a65 (patch) | |
tree | e8807c199947121a739a5935538ff63d235dd714 | |
parent | ebb2475c4731d9c9940db6ff6514fab723e1f489 (diff) |
gpu: host1x: syncpt: Use kcalloc() instead of kzalloc()
Use kcalloc() to allocate arrays rather than passing the product of the
size per element by the number of elements to kzalloc().
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/gpu/host1x/syncpt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index 3e9119301f6c..d70aad5c9f05 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c | |||
@@ -343,12 +343,12 @@ int host1x_syncpt_init(struct host1x *host) | |||
343 | struct host1x_syncpt *syncpt; | 343 | struct host1x_syncpt *syncpt; |
344 | unsigned int i; | 344 | unsigned int i; |
345 | 345 | ||
346 | syncpt = devm_kzalloc(host->dev, sizeof(*syncpt) * host->info->nb_pts, | 346 | syncpt = devm_kcalloc(host->dev, host->info->nb_pts, sizeof(*syncpt), |
347 | GFP_KERNEL); | 347 | GFP_KERNEL); |
348 | if (!syncpt) | 348 | if (!syncpt) |
349 | return -ENOMEM; | 349 | return -ENOMEM; |
350 | 350 | ||
351 | bases = devm_kzalloc(host->dev, sizeof(*bases) * host->info->nb_bases, | 351 | bases = devm_kcalloc(host->dev, host->info->nb_bases, sizeof(*bases), |
352 | GFP_KERNEL); | 352 | GFP_KERNEL); |
353 | if (!bases) | 353 | if (!bases) |
354 | return -ENOMEM; | 354 | return -ENOMEM; |