[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201229135223.23815-1-zhengyongjun3@huawei.com>
Date: Tue, 29 Dec 2020 21:52:23 +0800
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <linux-rdma@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <dledford@...hat.com>, <jgg@...pe.ca>,
Zheng Yongjun <zhengyongjun3@...wei.com>
Subject: [PATCH -next] RDMA/rw: 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@...wei.com>
---
drivers/infiniband/core/rw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
index 13f43ab7220b..a41413c51609 100644
--- a/drivers/infiniband/core/rw.c
+++ b/drivers/infiniband/core/rw.c
@@ -407,7 +407,7 @@ int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
ctx->type = RDMA_RW_SIG_MR;
ctx->nr_ops = 1;
- ctx->reg = kcalloc(1, sizeof(*ctx->reg), GFP_KERNEL);
+ ctx->reg = kzalloc(sizeof(*ctx->reg), GFP_KERNEL);
if (!ctx->reg) {
ret = -ENOMEM;
goto out_unmap_prot_sg;
--
2.22.0
Powered by blists - more mailing lists