Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] otx2_common: Use devm_kcalloc() in otx2_config_npa()
@ 2020-08-17 2:04 Xu Wang
2020-08-17 22:08 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2020-08-17 2:04 UTC (permalink / raw)
To: sgoutham, gakula, sbhatta, hkelam, davem, kuba, netdev
Cc: linux-kernel, Xu Wang
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "devm_kcalloc".
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
index 5975521a4c86..93c4cf7fedbf 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
@@ -1226,8 +1226,8 @@ int otx2_config_npa(struct otx2_nic *pfvf)
if (!hw->pool_cnt)
return -EINVAL;
- qset->pool = devm_kzalloc(pfvf->dev, sizeof(struct otx2_pool) *
- hw->pool_cnt, GFP_KERNEL);
+ qset->pool = devm_kcalloc(pfvf->dev, hw->pool_cnt,
+ sizeof(struct otx2_pool), GFP_KERNEL);
if (!qset->pool)
return -ENOMEM;
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] otx2_common: Use devm_kcalloc() in otx2_config_npa()
2020-08-17 2:04 [PATCH] otx2_common: Use devm_kcalloc() in otx2_config_npa() Xu Wang
@ 2020-08-17 22:08 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-08-17 22:08 UTC (permalink / raw)
To: vulab; +Cc: sgoutham, gakula, sbhatta, hkelam, kuba, netdev, linux-kernel
From: Xu Wang <vulab@iscas.ac.cn>
Date: Mon, 17 Aug 2020 02:04:13 +0000
> A multiplication for the size determination of a memory allocation
> indicated that an array data structure should be processed.
> Thus use the corresponding function "devm_kcalloc".
>
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-17 22:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 2:04 [PATCH] otx2_common: Use devm_kcalloc() in otx2_config_npa() Xu Wang
2020-08-17 22:08 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).