Since the function ulog64() only has one caller and since it can be
replaced by a single closed-form expression, inline that function.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
uint64_t nr_bits;
};
-static inline unsigned long ulog64(unsigned long val, unsigned int log)
-{
- while (log-- && val)
- val >>= UNIT_SHIFT;
-
- return val;
-}
-
/* Remove all elements from the @axmap set */
void axmap_reset(struct axmap *axmap)
{
int i;
for (i = axmap->nr_levels - 1; i >= 0; i--) {
- unsigned long index = ulog64(bit_nr, i);
+ unsigned long index = bit_nr >> (UNIT_SHIFT * i);
unsigned long offset = index >> UNIT_SHIFT;
unsigned int bit = index & BLOCKS_PER_UNIT_MASK;