[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <af578bd3eb471b9613bcba7f714cca7e297a4620.1643214385.git.robin.murphy@arm.com>
Date: Wed, 26 Jan 2022 16:30:33 +0000
From: Robin Murphy <robin.murphy@....com>
To: simon.horman@...igine.com, kuba@...nel.org, davem@...emloft.net
Cc: oss-drivers@...igine.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH net-next] nfp: nsp: Simplify array allocation
Prefer kcalloc() to kzalloc(array_size()) for allocating an array.
Signed-off-by: Robin Murphy <robin.murphy@....com>
---
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c
index 10e7d8b21c46..730fea214b8a 100644
--- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c
@@ -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;
--
2.28.0.dirty
Powered by blists - more mailing lists