axmap: clean up 'no bits to set' case
authorJens Axboe <axboe@kernel.dk>
Wed, 11 Jul 2018 14:34:06 +0000 (08:34 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 11 Jul 2018 14:34:06 +0000 (08:34 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/axmap.c

index c29597f..2a9463d 100644 (file)
@@ -237,10 +237,10 @@ static bool axmap_set_fn(struct axmap_level *al, unsigned long offset,
        if (overlap) {
                const int __bit = ffz(~overlap);
 
-               if (__bit == bit)
+               nr_bits = __bit - bit;
+               if (!nr_bits)
                        return true;
 
-               nr_bits = __bit - bit;
                mask = bit_masks[nr_bits] << bit;
        }