From: Maher Sanalla <msanalla@xxxxxxxxxx> Replace the usage of ccan bitmap with the newly added bitmap implementation in util. Signed-off-by: Maher Sanalla <msanalla@xxxxxxxxxx> Reviewed-by: Avihai Horon <avihaih@xxxxxxxxxx> Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxx> --- providers/hns/hns_roce_u.h | 4 ++-- providers/hns/hns_roce_u_db.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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]; -- 1.8.3.1