summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2018-08-22 13:35:19 -0700
committerBart Van Assche <bvanassche@acm.org>2018-08-22 18:59:24 -0700
commita1a4ab815fe74ba54086b92206cf632b6c3aba4c (patch)
tree578568fc5b7c0ce26b028cf67ba82714a655c22d /lib
parentc71430182a39fdf358d161ac2d0e01eb4ac285ce (diff)
downloadfio-a1a4ab815fe74ba54086b92206cf632b6c3aba4c.tar.gz
fio-a1a4ab815fe74ba54086b92206cf632b6c3aba4c.tar.bz2
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 <bart.vanassche@wdc.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/axmap.c10
1 files changed, 1 insertions, 9 deletions
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;