diff options
author | Zheng Yongjun <zhengyongjun3@huawei.com> | 2020-12-29 16:53:09 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-01-06 02:43:42 +0300 |
commit | da2c3ee13e184fea1121eac185e4bfee11a30303 (patch) | |
tree | bef3b7fa4c791082ec28b28755a14dd275bca017 /drivers/net/ethernet/marvell/octeontx2/af/cgx.c | |
parent | 8a57965ef33d280cef25b75c707857e9977b04f5 (diff) | |
download | linux-da2c3ee13e184fea1121eac185e4bfee11a30303.tar.xz |
octeontx2-af: Use kzalloc for allocating only one thing
Use kzalloc rather than kcalloc(1,...)
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
@@
- kcalloc(1,
+ kzalloc(
...)
// </smpl>
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/octeontx2/af/cgx.c')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c index 7d0f96290943..1156c61f2e02 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c @@ -867,7 +867,7 @@ static int cgx_lmac_init(struct cgx *cgx) cgx->lmac_count = MAX_LMAC_PER_CGX; for (i = 0; i < cgx->lmac_count; i++) { - lmac = kcalloc(1, sizeof(struct lmac), GFP_KERNEL); + lmac = kzalloc(sizeof(struct lmac), GFP_KERNEL); if (!lmac) return -ENOMEM; lmac->name = kcalloc(1, sizeof("cgx_fwi_xxx_yyy"), GFP_KERNEL); |