From: Bart Van Assche Date: Wed, 22 Aug 2018 17:43:46 +0000 (-0700) Subject: lib/axmap: Simplify axmap_set_fn() X-Git-Tag: fio-3.9~19^2~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=15a4f4962fad9e1777bcc662b3391f521ace8c5b 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 --- 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; }