Commit d9f393f4 authored by Robin Murphy's avatar Robin Murphy Committed by David S. Miller

nfp: Simplify array allocation

Prefer kcalloc() to kzalloc(array_size()) for allocating an array.
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Acked-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a9c5eb64
...@@ -513,7 +513,7 @@ nfp_nsp_command_buf_dma_sg(struct nfp_nsp *nsp, ...@@ -513,7 +513,7 @@ nfp_nsp_command_buf_dma_sg(struct nfp_nsp *nsp,
dma_size = BIT_ULL(dma_order); dma_size = BIT_ULL(dma_order);
nseg = DIV_ROUND_UP(max_size, chunk_size); nseg = DIV_ROUND_UP(max_size, chunk_size);
chunks = kzalloc(array_size(sizeof(*chunks), nseg), GFP_KERNEL); chunks = kcalloc(nseg, sizeof(*chunks), GFP_KERNEL);
if (!chunks) if (!chunks)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment