eal: simplify meson build of common directory
[dpdk.git] / lib / librte_eal / common / include / rte_bitmap.h
index d2ed620..6b846f2 100644 (file)
@@ -93,16 +93,6 @@ __rte_bitmap_index2_set(struct rte_bitmap *bmp)
        bmp->index2 = (((bmp->index1 << RTE_BITMAP_SLAB_BIT_SIZE_LOG2) + bmp->offset1) << RTE_BITMAP_CL_SLAB_SIZE_LOG2);
 }
 
-static inline int
-rte_bsf64(uint64_t slab, uint32_t *pos)
-{
-       if (slab == 0)
-               return 0;
-
-       *pos = __builtin_ctzll(slab);
-       return 1;
-}
-
 static inline uint32_t
 __rte_bitmap_get_memory_footprint(uint32_t n_bits,
        uint32_t *array1_byte_offset, uint32_t *array1_slabs,
@@ -408,9 +398,8 @@ __rte_bitmap_scan_search(struct rte_bitmap *bmp)
        value1 = bmp->array1[bmp->index1];
        value1 &= __rte_bitmap_mask1_get(bmp);
 
-       if (rte_bsf64(value1, &bmp->offset1)) {
+       if (rte_bsf64_safe(value1, &bmp->offset1))
                return 1;
-       }
 
        __rte_bitmap_index1_inc(bmp);
        bmp->offset1 = 0;
@@ -419,9 +408,8 @@ __rte_bitmap_scan_search(struct rte_bitmap *bmp)
        for (i = 0; i < bmp->array1_size; i ++, __rte_bitmap_index1_inc(bmp)) {
                value1 = bmp->array1[bmp->index1];
 
-               if (rte_bsf64(value1, &bmp->offset1)) {
+               if (rte_bsf64_safe(value1, &bmp->offset1))
                        return 1;
-               }
        }
 
        return 0;