qemu-trivial
[Top][All Lists]
Advanced

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

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


From: Pavel Dovgalyuk
Subject: RE: [PATCH v1 15/59] block/blkreplay.c: remove unneeded 'fail' label in blkreplay_open()
Date: Fri, 10 Jan 2020 09:07:04 +0300

> From: Daniel Henrique Barboza [mailto:address@hidden]
> Sent: Monday, January 06, 2020 9:24 PM
> To: address@hidden
> Cc: address@hidden; Daniel Henrique Barboza; Pavel Dovgalyuk; Paolo Bonzini
> Subject: [PATCH v1 15/59] block/blkreplay.c: remove unneeded 'fail' label in 
> blkreplay_open()
> 
> 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>


Reviewed-by: Pavel Dovgalyuk <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



Pavel Dovgalyuk




reply via email to

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