[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b71ccfaf4a47dee8e1ad373604c861479d499b6b.1657298747.git.christophe.jaillet@wanadoo.fr>
Date: Fri, 8 Jul 2022 18:47:37 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: "Md. Haris Iqbal" <haris.iqbal@...os.com>,
Jack Wang <jinpu.wang@...os.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-rdma@...r.kernel.org
Subject: [PATCH 2/2] RDMA/rtrs-clt: Use bitmap_empty()
Use bitmap_empty() instead of hand-writing them.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index 06c27a3d83f5..8441f0965b56 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -1433,12 +1433,10 @@ static int alloc_permits(struct rtrs_clt_sess *clt)
static void free_permits(struct rtrs_clt_sess *clt)
{
- if (clt->permits_map) {
- size_t sz = clt->queue_depth;
-
+ if (clt->permits_map)
wait_event(clt->permits_wait,
- find_first_bit(clt->permits_map, sz) >= sz);
- }
+ bitmap_empty(clt->permits_map, clt->queue_depth));
+
bitmap_free(clt->permits_map);
clt->permits_map = NULL;
kfree(clt->permits);
--
2.34.1
Powered by blists - more mailing lists