From: Xu Wang Date: Sat, 25 Jul 2020 12:00:17 +0000 (+0800) Subject: bcache: journel: use for_each_clear_bit() to simplify the code X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ef4eeb855f741586ed120d3f08ed53bb0968244e;p=linux.git bcache: journel: use for_each_clear_bit() to simplify the code Using for_each_clear_bit() to simplify the code. Signed-off-by: Xu Wang Signed-off-by: Coly Li Signed-off-by: Jens Axboe --- diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index d8586b6ccb76a..77fbfd52edcf9 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -217,10 +217,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list) */ pr_debug("falling back to linear search\n"); - for (l = find_first_zero_bit(bitmap, ca->sb.njournal_buckets); - l < ca->sb.njournal_buckets; - l = find_next_zero_bit(bitmap, ca->sb.njournal_buckets, - l + 1)) + for_each_clear_bit(l, bitmap, ca->sb.njournal_buckets) if (read_bucket(l)) goto bsearch;