From: Zheng Yongjun Date: Tue, 29 Dec 2020 13:53:09 +0000 (+0800) Subject: octeontx2-af: Use kzalloc for allocating only one thing X-Git-Tag: accepted/tizen/unified/20230118.172025~7901^2~412 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da2c3ee13e184fea1121eac185e4bfee11a30303;p=platform%2Fkernel%2Flinux-rpi.git 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/) // @@ @@ - kcalloc(1, + kzalloc( ...) // Signed-off-by: Zheng Yongjun Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c index 7d0f962..1156c61 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);