diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2023-02-07 20:35:25 +0100 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2023-02-14 20:23:07 +0100 |
commit | 1c3fe2fa946342a784a1375a63be6eb5a25acd76 (patch) | |
tree | ff3144c87bb004de96df6a91ac18c790cf0edcec /drivers | |
parent | dm: favour __packed versus "__attribute__ ((packed))" (diff) | |
download | linux-1c3fe2fa946342a784a1375a63be6eb5a25acd76.tar.xz linux-1c3fe2fa946342a784a1375a63be6eb5a25acd76.zip |
dm: avoid useless 'else' after 'break' or return'
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-stripe.c | 8 | ||||
-rw-r--r-- | drivers/md/dm-thin-metadata.c | 4 | ||||
-rw-r--r-- | drivers/md/dm-verity-target.c | 33 | ||||
-rw-r--r-- | drivers/md/dm-writecache.c | 16 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-btree.c | 4 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-space-map-common.c | 11 |
6 files changed, 38 insertions, 38 deletions
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index e0e665efb285..4335828a43e4 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -259,11 +259,11 @@ static int stripe_map_range(struct stripe_c *sc, struct bio *bio, sc->stripe[target_stripe].physical_start; bio->bi_iter.bi_size = to_bytes(end - begin); return DM_MAPIO_REMAPPED; - } else { - /* The range doesn't map to the target stripe */ - bio_endio(bio); - return DM_MAPIO_SUBMITTED; } + + /* The range doesn't map to the target stripe */ + bio_endio(bio); + return DM_MAPIO_SUBMITTED; } static int stripe_map(struct dm_target *ti, struct bio *bio) diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 2b12e0e2c879..fd464fb024c3 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -1612,8 +1612,8 @@ static int __find_mapped_range(struct dm_thin_device *td, if (r) { if (r == -ENODATA) break; - else - return r; + + return r; } if ((lookup.block != pool_end) || diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 0f9814099d1b..ade83ef3b439 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -110,23 +110,24 @@ static int verity_hash_update(struct dm_verity *v, struct ahash_request *req, sg_init_one(&sg, data, len); ahash_request_set_crypt(req, &sg, NULL, len); return crypto_wait_req(crypto_ahash_update(req), wait); - } else { - do { - int r; - size_t this_step = min_t(size_t, len, PAGE_SIZE - offset_in_page(data)); - - flush_kernel_vmap_range((void *)data, this_step); - sg_init_table(&sg, 1); - sg_set_page(&sg, vmalloc_to_page(data), this_step, offset_in_page(data)); - ahash_request_set_crypt(req, &sg, NULL, this_step); - r = crypto_wait_req(crypto_ahash_update(req), wait); - if (unlikely(r)) - return r; - data += this_step; - len -= this_step; - } while (len); - return 0; } + + do { + int r; + size_t this_step = min_t(size_t, len, PAGE_SIZE - offset_in_page(data)); + + flush_kernel_vmap_range((void *)data, this_step); + sg_init_table(&sg, 1); + sg_set_page(&sg, vmalloc_to_page(data), this_step, offset_in_page(data)); + ahash_request_set_crypt(req, &sg, NULL, this_step); + r = crypto_wait_req(crypto_ahash_update(req), wait); + if (unlikely(r)) + return r; + data += this_step; + len -= this_step; + } while (len); + + return 0; } /* diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 2dfa612fa1ef..70a110a41c44 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -623,15 +623,15 @@ static struct wc_entry *writecache_find_entry(struct dm_writecache *wc, if (unlikely(!node)) { if (!(flags & WFE_RETURN_FOLLOWING)) return NULL; - if (read_original_sector(wc, e) >= block) { + if (read_original_sector(wc, e) >= block) return e; - } else { - node = rb_next(&e->rb_node); - if (unlikely(!node)) - return NULL; - e = container_of(node, struct wc_entry, rb_node); - return e; - } + + node = rb_next(&e->rb_node); + if (unlikely(!node)) + return NULL; + + e = container_of(node, struct wc_entry, rb_node); + return e; } } diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index f4c63060ea27..bb8b34ffeafc 100644 --- a/drivers/md/persistent-data/dm-btree.c +++ b/drivers/md/persistent-data/dm-btree.c @@ -1352,8 +1352,8 @@ static int find_key(struct ro_spine *s, dm_block_t block, bool find_highest, i = le32_to_cpu(ro_node(s)->header.nr_entries); if (!i) return -ENODATA; - else - i--; + + i--; if (find_highest) *result_key = le64_to_cpu(ro_node(s)->keys[i]); diff --git a/drivers/md/persistent-data/dm-space-map-common.c b/drivers/md/persistent-data/dm-space-map-common.c index e927ed853215..591d1a43d035 100644 --- a/drivers/md/persistent-data/dm-space-map-common.c +++ b/drivers/md/persistent-data/dm-space-map-common.c @@ -793,13 +793,12 @@ static int __sm_ll_dec_overflow(struct ll_disk *ll, dm_block_t b, rc = le32_to_cpu(*v_ptr); *old_rc = rc; - if (rc == 3) { + if (rc == 3) return __sm_ll_del_overflow(ll, b, ic); - } else { - rc--; - *v_ptr = cpu_to_le32(rc); - return 0; - } + + rc--; + *v_ptr = cpu_to_le32(rc); + return 0; } static int sm_ll_dec_overflow(struct ll_disk *ll, dm_block_t b, |