sbitmap: remove unnecessary calculation of alloc_hint in __sbitmap_get_shallow
authorKemeng Shi <shikemeng@huaweicloud.com>
Mon, 16 Jan 2023 20:50:55 +0000 (04:50 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 30 Jan 2023 03:03:01 +0000 (20:03 -0700)
commitf1591a8bb3e02713f4ee2efe20df0d84ed80da48
tree60af1db825630c48e97d818acb45d71fdc09eeef
parentf1c006f1c6850c14040f8337753a63119bba39b9
sbitmap: remove unnecessary calculation of alloc_hint in __sbitmap_get_shallow

Updates to alloc_hint in the loop in __sbitmap_get_shallow() are mostly
pointless and equivalent to setting alloc_hint to zero (because
SB_NR_TO_BIT() considers only low sb->shift bits from alloc_hint). So
simplify the logic.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Link: https://lore.kernel.org/r/20230116205059.3821738-2-shikemeng@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/sbitmap.c