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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;