diff options
author | Zheng Yongjun <zhengyongjun3@huawei.com> | 2020-12-29 16:52:23 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-01-07 23:47:53 +0300 |
commit | aaf1226bd95b25b910617019a71d0de13f221c9d (patch) | |
tree | 1b56ef93af7f56426a4bebf05cbe7cbc087afbc8 /drivers/infiniband/core | |
parent | 0ccccb045c870a34730319cb1fb9cad8c8d53f2b (diff) | |
download | linux-aaf1226bd95b25b910617019a71d0de13f221c9d.tar.xz |
RDMA: 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>
Link: https://lore.kernel.org/r/20201229135223.23815-1-zhengyongjun3@huawei.com
Link: https://lore.kernel.org/r/20201229135232.23869-1-zhengyongjun3@huawei.com
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r-- | drivers/infiniband/core/rw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c index a96030b784eb..31156e22d3e7 100644 --- a/drivers/infiniband/core/rw.c +++ b/drivers/infiniband/core/rw.c @@ -410,7 +410,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; |