The label "out" is excess, lets remove it in accordance with: "If there is no cleanup needed then just return directly." https://www.kernel.org/doc/html/v4.10/process/coding-style.html#centralized-exiting-of-functions
https://virtuozzo.atlassian.net/browse/VSTOR-100466 Signed-off-by: Pavel Tikhomirov <ptikhomi...@virtuozzo.com> --- drivers/md/dm-qcow2-cmd.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/md/dm-qcow2-cmd.c b/drivers/md/dm-qcow2-cmd.c index 6dc7e07220557..7b4b0ee68ad9f 100644 --- a/drivers/md/dm-qcow2-cmd.c +++ b/drivers/md/dm-qcow2-cmd.c @@ -166,18 +166,14 @@ static int qcow2_merge_backward(struct qcow2_target *tgt) struct qcow2 *qcow2 = tgt->top, *lower = qcow2->lower; int ret, ret2; - ret = -ENOENT; if (!lower) - goto out; - ret = -EACCES; + return -ENOENT; if (!(lower->file->f_mode & FMODE_WRITE)) - goto out; - ret = -EOPNOTSUPP; + return -EACCES; if (qcow2->clu_size != lower->clu_size) - goto out; - ret = -EBADSLT; + return -EOPNOTSUPP; if (lower->hdr.size < qcow2->hdr.size) - goto out; + return -EBADSLT; /* * Break all COW clus at L1 level. Otherwise, later * there would be problems with unusing them: @@ -187,13 +183,13 @@ static int qcow2_merge_backward(struct qcow2_target *tgt) ret = qcow2_break_l1cow(tgt); if (ret) { QC_ERR(tgt->ti, "Can't break L1 COW"); - goto out; + return ret; } ret = qcow2_set_image_file_features(lower, true); if (ret) { QC_ERR(tgt->ti, "Can't set dirty bit"); - goto out; + return ret; } set_backward_merge_in_process(tgt, qcow2, true); @@ -204,7 +200,7 @@ static int qcow2_merge_backward(struct qcow2_target *tgt) ret2 = qcow2_set_image_file_features(lower, false); if (ret2 < 0) QC_ERR(tgt->ti, "Can't unuse lower (%d)", ret2); - goto out; + return ret; } tgt->top = lower; smp_wmb(); /* Pairs with qcow2_ref_inc() */ @@ -216,8 +212,8 @@ static int qcow2_merge_backward(struct qcow2_target *tgt) if (ret2 < 0) QC_ERR(tgt->ti, "Can't unuse merged img (%d)", ret2); qcow2_destroy(qcow2); -out: - return ret; + + return 0; } ALLOW_ERROR_INJECTION(qcow2_merge_backward, ERRNO); -- 2.48.1 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel