diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2023-01-31 00:13:54 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2023-02-14 22:23:06 +0300 |
commit | 03b18887703c5fa342896e52e873812ea33d964b (patch) | |
tree | f4018443dba31b2c4bfd2efb7c376ff00c8c7e66 /drivers/md/dm-integrity.c | |
parent | 43be9c743c2553519c2093d1798b542f28095a51 (diff) | |
download | linux-03b18887703c5fa342896e52e873812ea33d964b.tar.xz |
dm: fix trailing statements
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-integrity.c')
-rw-r--r-- | drivers/md/dm-integrity.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 46167422164e..524fecad0563 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -679,16 +679,18 @@ repeat: } else if (mode == BITMAP_OP_CLEAR) { if (!bit && this_end_bit == PAGE_SIZE * 8 - 1) clear_page(data); - else while (bit <= this_end_bit) { - if (!(bit % BITS_PER_LONG) && this_end_bit >= bit + BITS_PER_LONG - 1) { - do { - data[bit / BITS_PER_LONG] = 0; - bit += BITS_PER_LONG; - } while (this_end_bit >= bit + BITS_PER_LONG - 1); - continue; + else { + while (bit <= this_end_bit) { + if (!(bit % BITS_PER_LONG) && this_end_bit >= bit + BITS_PER_LONG - 1) { + do { + data[bit / BITS_PER_LONG] = 0; + bit += BITS_PER_LONG; + } while (this_end_bit >= bit + BITS_PER_LONG - 1); + continue; + } + __clear_bit(bit, data); + bit++; } - __clear_bit(bit, data); - bit++; } } else { BUG(); @@ -2010,23 +2012,23 @@ retry_kmap: unsigned int tag_todo = ic->tag_size; char *tag_ptr = journal_entry_tag(ic, je); - if (bip) do { - struct bio_vec biv = bvec_iter_bvec(bip->bip_vec, bip->bip_iter); - unsigned int tag_now = min(biv.bv_len, tag_todo); - char *tag_addr; - BUG_ON(PageHighMem(biv.bv_page)); - tag_addr = bvec_virt(&biv); - if (likely(dio->op == REQ_OP_WRITE)) - memcpy(tag_ptr, tag_addr, tag_now); - else - memcpy(tag_addr, tag_ptr, tag_now); - bvec_iter_advance(bip->bip_vec, &bip->bip_iter, tag_now); - tag_ptr += tag_now; - tag_todo -= tag_now; - } while (unlikely(tag_todo)); else { - if (likely(dio->op == REQ_OP_WRITE)) - memset(tag_ptr, 0, tag_todo); - } + if (bip) { + do { + struct bio_vec biv = bvec_iter_bvec(bip->bip_vec, bip->bip_iter); + unsigned int tag_now = min(biv.bv_len, tag_todo); + char *tag_addr; + BUG_ON(PageHighMem(biv.bv_page)); + tag_addr = bvec_virt(&biv); + if (likely(dio->op == REQ_OP_WRITE)) + memcpy(tag_ptr, tag_addr, tag_now); + else + memcpy(tag_addr, tag_ptr, tag_now); + bvec_iter_advance(bip->bip_vec, &bip->bip_iter, tag_now); + tag_ptr += tag_now; + tag_todo -= tag_now; + } while (unlikely(tag_todo)); + } else if (likely(dio->op == REQ_OP_WRITE)) + memset(tag_ptr, 0, tag_todo); } if (likely(dio->op == REQ_OP_WRITE)) { |