diff options
author | Bart Van Assche <bart.vanassche@wdc.com> | 2018-08-22 10:43:46 -0700 |
---|---|---|
committer | Bart Van Assche <bvanassche@acm.org> | 2018-08-22 18:59:24 -0700 |
commit | 15a4f4962fad9e1777bcc662b3391f521ace8c5b (patch) | |
tree | 15c44d03b7de506c6cd7d0cae1ce0539fc3e25a9 /lib | |
parent | 70c0f35624b32a86603c034e28e6b09907868100 (diff) | |
download | fio-15a4f4962fad9e1777bcc662b3391f521ace8c5b.tar.gz fio-15a4f4962fad9e1777bcc662b3391f521ace8c5b.tar.bz2 |
lib/axmap: Simplify axmap_set_fn()
Instead of handling ffz(~overlap) == bit as a special case, handle
this case in the same way as ffz(~overlap) != bit. This patch does
not change any functionality but removes one if-instruction from the
hot path.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/axmap.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/axmap.c b/lib/axmap.c index 781a1039..336d7048 100644 --- a/lib/axmap.c +++ b/lib/axmap.c @@ -235,18 +235,12 @@ static bool axmap_set_fn(struct axmap_level *al, unsigned long offset, */ overlap = al->map[offset] & mask; if (overlap == mask) { -done: data->set_bits = 0; return true; } if (overlap) { - const int __bit = ffz(~overlap); - - nr_bits = __bit - bit; - if (!nr_bits) - goto done; - + nr_bits = ffz(~overlap) - bit; mask = bit_masks[nr_bits] << bit; } |