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/md/dm-verity-target.c | |
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/md/dm-verity-target.c')
-rw-r--r-- | drivers/md/dm-verity-target.c | 33 |
1 files changed, 17 insertions, 16 deletions
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; } /* |