Messages in this thread Patch in this message |  | | From | Zheng Yongjun <> | Subject | [PATCH -next] RDMA/rw: Use kzalloc for allocating only one thing | Date | Tue, 29 Dec 2020 21:52:23 +0800 |
| |
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> --- 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
|  |