qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 15/59] block/blkreplay.c: remove unneeded 'fail' label in blkr


From: Daniel Henrique Barboza
Subject: [PATCH v1 15/59] block/blkreplay.c: remove unneeded 'fail' label in blkreplay_open()
Date: Mon, 6 Jan 2020 15:23:41 -0300

Both the 'fail' label and the 'ret' variable can be removed.
Use 'return -EINVAL' in the error condition and 'return 0' in
the end of the function.

CC: Pavel Dovgalyuk <address@hidden>
CC: Paolo Bonzini <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
 block/blkreplay.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/block/blkreplay.c b/block/blkreplay.c
index c96ac8f4bc..d8c4c311f3 100644
--- a/block/blkreplay.c
+++ b/block/blkreplay.c
@@ -24,23 +24,19 @@ static int blkreplay_open(BlockDriverState *bs, QDict 
*options, int flags,
                           Error **errp)
 {
     Error *local_err = NULL;
-    int ret;
 
     /* Open the image file */
     bs->file = bdrv_open_child(NULL, options, "image",
                                bs, &child_file, false, &local_err);
     if (local_err) {
-        ret = -EINVAL;
         error_propagate(errp, local_err);
-        goto fail;
+        return -EINVAL;
     }
 
     bs->supported_write_flags = BDRV_REQ_WRITE_UNCHANGED;
     bs->supported_zero_flags = BDRV_REQ_WRITE_UNCHANGED;
 
-    ret = 0;
-fail:
-    return ret;
+    return 0;
 }
 
 static int64_t blkreplay_getlength(BlockDriverState *bs)
-- 
2.24.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]