From c2e48e0e228d66a1a12cc2498548d8294c9436e7 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 11 Jul 2018 08:34:06 -0600 Subject: [PATCH] axmap: clean up 'no bits to set' case Signed-off-by: Jens Axboe --- lib/axmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/axmap.c b/lib/axmap.c index c29597f8..2a9463dc 100644 --- a/lib/axmap.c +++ b/lib/axmap.c @@ -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; } -- 2.25.1