From: Leon Romanovsky <leon@kernel.org>
To: Selvin Xavier <selvin.xavier@broadcom.com>,
Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH rdma-next 3/4] RDMA/bnxt_re: Replace kcalloc() with kzalloc_objs()
Date: Wed, 18 Mar 2026 12:08:52 +0200 [thread overview]
Message-ID: <20260318-bnxt_re-cq-v1-3-381cb1b5e625@nvidia.com> (raw)
In-Reply-To: <20260318-bnxt_re-cq-v1-0-381cb1b5e625@nvidia.com>
From: Leon Romanovsky <leonro@nvidia.com>
New code should use kzalloc_objs() instead of kcalloc(). Update the driver
accordingly.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index cb53dfdf69bab..1aee4fec137eb 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -3486,8 +3486,7 @@ int bnxt_re_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
cq->qplib_cq.cq_handle = (u64)(unsigned long)(&cq->qplib_cq);
cq->max_cql = attr->cqe + 1;
- cq->cql = kcalloc(cq->max_cql, sizeof(struct bnxt_qplib_cqe),
- GFP_KERNEL);
+ cq->cql = kzalloc_objs(struct bnxt_qplib_cqe, cq->max_cql);
if (!cq->cql)
return -ENOMEM;
@@ -4413,7 +4412,7 @@ struct ib_mr *bnxt_re_alloc_mr(struct ib_pd *ib_pd, enum ib_mr_type type,
mr->ib_mr.lkey = mr->qplib_mr.lkey;
mr->ib_mr.rkey = mr->ib_mr.lkey;
- mr->pages = kcalloc(max_num_sg, sizeof(u64), GFP_KERNEL);
+ mr->pages = kzalloc_objs(u64, max_num_sg);
if (!mr->pages) {
rc = -ENOMEM;
goto fail;
--
2.53.0
next prev parent reply other threads:[~2026-03-18 10:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 10:08 [PATCH rdma-next 0/4] RDMA/bnxt_re: Miscellaneous cleanups Leon Romanovsky
2026-03-18 10:08 ` [PATCH rdma-next 1/4] RDMA/bnxt_re: Simplify bnxt_re_init_depth() callers and implementation Leon Romanovsky
2026-03-23 6:16 ` Selvin Xavier
2026-03-23 11:14 ` Leon Romanovsky
2026-03-23 17:08 ` Selvin Xavier
2026-03-18 10:08 ` [PATCH rdma-next 2/4] RDMA/bnxt_re: Remove unnecessary checks in kernel CQ creation path Leon Romanovsky
2026-03-23 6:21 ` Selvin Xavier
2026-03-18 10:08 ` Leon Romanovsky [this message]
2026-03-23 6:45 ` [PATCH rdma-next 3/4] RDMA/bnxt_re: Replace kcalloc() with kzalloc_objs() Selvin Xavier
2026-03-18 10:08 ` [PATCH rdma-next 4/4] RDMA/bnxt_re: Clean up uverbs CQ creation path Leon Romanovsky
2026-03-23 6:45 ` Selvin Xavier
2026-03-23 19:25 ` [PATCH rdma-next 0/4] RDMA/bnxt_re: Miscellaneous cleanups Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260318-bnxt_re-cq-v1-3-381cb1b5e625@nvidia.com \
--to=leon@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=selvin.xavier@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®