mirror of
https://github.com/torvalds/linux.git
synced 2024-12-05 18:41:23 +00:00
nfp: Simplify array allocation
Prefer kcalloc() to kzalloc(array_size()) for allocating an array. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Acked-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a9c5eb642f
commit
d9f393f468
@ -513,7 +513,7 @@ nfp_nsp_command_buf_dma_sg(struct nfp_nsp *nsp,
|
||||
dma_size = BIT_ULL(dma_order);
|
||||
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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user