From: Bart Van Assche Date: Wed, 22 Aug 2018 20:35:19 +0000 (-0700) Subject: lib/axmap: Inline ulog64() X-Git-Tag: fio-3.9~19^2~3 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=a1a4ab815fe74ba54086b92206cf632b6c3aba4c;p=fio.git lib/axmap: Inline ulog64() 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 --- diff --git a/lib/axmap.c b/lib/axmap.c index 4a907fec..0d8fbf8d 100644 --- a/lib/axmap.c +++ b/lib/axmap.c @@ -83,14 +83,6 @@ struct axmap { 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) { @@ -202,7 +194,7 @@ static bool axmap_handler_topdown(struct axmap *axmap, uint64_t bit_nr, 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;