diff mbox series

[rdma-core,3/5] libhns: Adapt bitmap usage to use util API

Message ID 20220228084830.96274-4-yishaih@nvidia.com (mailing list archive)
State Not Applicable
Headers show
Series Add new bitmap API | expand

Commit Message

Yishai Hadas Feb. 28, 2022, 8:48 a.m. UTC
From: Maher Sanalla <msanalla@nvidia.com>

Replace the usage of ccan bitmap with the newly added bitmap
implementation in util.

Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
---
 providers/hns/hns_roce_u.h    | 4 ++--
 providers/hns/hns_roce_u_db.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h
index 2b4ba18..d786efb 100644
--- a/providers/hns/hns_roce_u.h
+++ b/providers/hns/hns_roce_u.h
@@ -42,7 +42,7 @@ 
 #include <util/util.h>
 #include <infiniband/verbs.h>
 #include <ccan/array_size.h>
-#include <ccan/bitmap.h>
+#include <util/bitmap.h>
 #include <ccan/container_of.h>
 #include <linux/if_ether.h>
 #include "hns_roce_u_abi.h"
@@ -193,7 +193,7 @@  struct hns_roce_db_page {
 	struct hns_roce_buf	buf;
 	unsigned int		num_db;
 	unsigned int		use_cnt;
-	bitmap			*bitmap;
+	unsigned long		*bitmap;
 };
 
 struct hns_roce_context {
diff --git a/providers/hns/hns_roce_u_db.c b/providers/hns/hns_roce_u_db.c
index f7aaa6e..f5acac2 100644
--- a/providers/hns/hns_roce_u_db.c
+++ b/providers/hns/hns_roce_u_db.c
@@ -33,7 +33,7 @@ 
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <ccan/bitmap.h>
+#include <util/bitmap.h>
 #include "hns_roce_u.h"
 #include "hns_roce_u_db.h"
 
@@ -109,7 +109,7 @@  void *hns_roce_alloc_db(struct hns_roce_context *ctx,
 found:
 	++page->use_cnt;
 
-	npos = bitmap_ffs(page->bitmap, 0, page->num_db);
+	npos = bitmap_find_first_bit(page->bitmap, 0, page->num_db);
 	bitmap_clear_bit(page->bitmap, npos);
 	db = page->buf.buf + npos * db_size[type];