Commit 1c3fe2fa authored by Heinz Mauelshagen's avatar Heinz Mauelshagen Committed by Mike Snitzer

dm: avoid useless 'else' after 'break' or return'

Signed-off-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent ae99111e
...@@ -259,11 +259,11 @@ static int stripe_map_range(struct stripe_c *sc, struct bio *bio, ...@@ -259,11 +259,11 @@ static int stripe_map_range(struct stripe_c *sc, struct bio *bio,
sc->stripe[target_stripe].physical_start; sc->stripe[target_stripe].physical_start;
bio->bi_iter.bi_size = to_bytes(end - begin); bio->bi_iter.bi_size = to_bytes(end - begin);
return DM_MAPIO_REMAPPED; return DM_MAPIO_REMAPPED;
} else { }
/* The range doesn't map to the target stripe */ /* The range doesn't map to the target stripe */
bio_endio(bio); bio_endio(bio);
return DM_MAPIO_SUBMITTED; return DM_MAPIO_SUBMITTED;
}
} }
static int stripe_map(struct dm_target *ti, struct bio *bio) static int stripe_map(struct dm_target *ti, struct bio *bio)
......
...@@ -1612,7 +1612,7 @@ static int __find_mapped_range(struct dm_thin_device *td, ...@@ -1612,7 +1612,7 @@ static int __find_mapped_range(struct dm_thin_device *td,
if (r) { if (r) {
if (r == -ENODATA) if (r == -ENODATA)
break; break;
else
return r; return r;
} }
......
...@@ -110,7 +110,8 @@ static int verity_hash_update(struct dm_verity *v, struct ahash_request *req, ...@@ -110,7 +110,8 @@ static int verity_hash_update(struct dm_verity *v, struct ahash_request *req,
sg_init_one(&sg, data, len); sg_init_one(&sg, data, len);
ahash_request_set_crypt(req, &sg, NULL, len); ahash_request_set_crypt(req, &sg, NULL, len);
return crypto_wait_req(crypto_ahash_update(req), wait); return crypto_wait_req(crypto_ahash_update(req), wait);
} else { }
do { do {
int r; int r;
size_t this_step = min_t(size_t, len, PAGE_SIZE - offset_in_page(data)); size_t this_step = min_t(size_t, len, PAGE_SIZE - offset_in_page(data));
...@@ -125,8 +126,8 @@ static int verity_hash_update(struct dm_verity *v, struct ahash_request *req, ...@@ -125,8 +126,8 @@ static int verity_hash_update(struct dm_verity *v, struct ahash_request *req,
data += this_step; data += this_step;
len -= this_step; len -= this_step;
} while (len); } while (len);
return 0; return 0;
}
} }
/* /*
......
...@@ -623,17 +623,17 @@ static struct wc_entry *writecache_find_entry(struct dm_writecache *wc, ...@@ -623,17 +623,17 @@ static struct wc_entry *writecache_find_entry(struct dm_writecache *wc,
if (unlikely(!node)) { if (unlikely(!node)) {
if (!(flags & WFE_RETURN_FOLLOWING)) if (!(flags & WFE_RETURN_FOLLOWING))
return NULL; return NULL;
if (read_original_sector(wc, e) >= block) { if (read_original_sector(wc, e) >= block)
return e; return e;
} else {
node = rb_next(&e->rb_node); node = rb_next(&e->rb_node);
if (unlikely(!node)) if (unlikely(!node))
return NULL; return NULL;
e = container_of(node, struct wc_entry, rb_node); e = container_of(node, struct wc_entry, rb_node);
return e; return e;
} }
} }
}
while (1) { while (1) {
struct wc_entry *e2; struct wc_entry *e2;
......
...@@ -1352,7 +1352,7 @@ static int find_key(struct ro_spine *s, dm_block_t block, bool find_highest, ...@@ -1352,7 +1352,7 @@ 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); i = le32_to_cpu(ro_node(s)->header.nr_entries);
if (!i) if (!i)
return -ENODATA; return -ENODATA;
else
i--; i--;
if (find_highest) if (find_highest)
......
...@@ -793,13 +793,12 @@ static int __sm_ll_dec_overflow(struct ll_disk *ll, dm_block_t b, ...@@ -793,13 +793,12 @@ static int __sm_ll_dec_overflow(struct ll_disk *ll, dm_block_t b,
rc = le32_to_cpu(*v_ptr); rc = le32_to_cpu(*v_ptr);
*old_rc = rc; *old_rc = rc;
if (rc == 3) { if (rc == 3)
return __sm_ll_del_overflow(ll, b, ic); return __sm_ll_del_overflow(ll, b, ic);
} else {
rc--; rc--;
*v_ptr = cpu_to_le32(rc); *v_ptr = cpu_to_le32(rc);
return 0; return 0;
}
} }
static int sm_ll_dec_overflow(struct ll_disk *ll, dm_block_t b, static int sm_ll_dec_overflow(struct ll_disk *ll, dm_block_t b,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment