linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] RDMA/rw: Use kzalloc for allocating only one thing
@ 2020-12-29 13:52 Zheng Yongjun
  2021-01-07 20:49 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-29 13:52 UTC (permalink / raw)
  To: linux-rdma, linux-kernel; +Cc: dledford, jgg, Zheng Yongjun

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] RDMA/rw: Use kzalloc for allocating only one thing
  2020-12-29 13:52 [PATCH -next] RDMA/rw: Use kzalloc for allocating only one thing Zheng Yongjun
@ 2021-01-07 20:49 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2021-01-07 20:49 UTC (permalink / raw)
  To: Zheng Yongjun; +Cc: linux-rdma, linux-kernel, dledford

On Tue, Dec 29, 2020 at 09:52:23PM +0800, Zheng Yongjun wrote:
> 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(-)

I applied this one and

 iw_cxgb4: Use kzalloc for allocating only one thing

Together as one commit to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-07 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-29 13:52 [PATCH -next] RDMA/rw: Use kzalloc for allocating only one thing Zheng Yongjun
2021-01-07 20:49 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).