Skip to content

Commit aaf1226

Browse files
Zheng Yongjunjgunthorpe
Zheng Yongjun
authored andcommitted
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/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Zheng Yongjun <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 0ccccb0 commit aaf1226

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/infiniband/core/rw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
410410

411411
ctx->type = RDMA_RW_SIG_MR;
412412
ctx->nr_ops = 1;
413-
ctx->reg = kcalloc(1, sizeof(*ctx->reg), GFP_KERNEL);
413+
ctx->reg = kzalloc(sizeof(*ctx->reg), GFP_KERNEL);
414414
if (!ctx->reg) {
415415
ret = -ENOMEM;
416416
goto out_unmap_prot_sg;

drivers/infiniband/hw/cxgb4/restrack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ int c4iw_fill_res_cm_id_entry(struct sk_buff *msg,
209209
epcp = (struct c4iw_ep_common *)iw_cm_id->provider_data;
210210
if (!epcp)
211211
return 0;
212-
uep = kcalloc(1, sizeof(*uep), GFP_KERNEL);
212+
uep = kzalloc(sizeof(*uep), GFP_KERNEL);
213213
if (!uep)
214214
return 0;
215215

0 commit comments

Comments
 (0)