hv: refine bit scan API

Rename
bsrl to bsr
bsrq to bsr64
bitmap_ffs to fls64
get_first_zero_bit to ffz64

Remove
ffsl

Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2018-05-22 12:03:02 +08:00
committed by lijinxia
parent 57d0bf3b7c
commit efb60e2726
5 changed files with 77 additions and 109 deletions

View File

@@ -81,7 +81,7 @@ static void *allocate_mem(struct mem_pool *pool, unsigned int num_bytes)
/* Find the first occurrence of requested_buffs number of free
* buffers. The 0th bit in bitmap represents a free buffer.
*/
for (bit_idx = get_first_zero_bit(pool->bitmap[idx]);
for (bit_idx = ffz64(pool->bitmap[idx]);
bit_idx < BITMAP_WORD_SIZE; bit_idx++) {
/* Check if selected buffer is free */
if (pool->bitmap[idx] & (1 << bit_idx))