qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 09/14] nbd/client: Refactor return of nbd_receiv


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-devel] [PATCH 09/14] nbd/client: Refactor return of nbd_receive_negotiate()
Date: Thu, 6 Dec 2018 14:24:52 +0000

01.12.2018 1:03, Eric Blake wrote:
> The function could only ever return 0 or -EINVAL; make this
> clearer by dropping a useless 'fail:' label.
> 
> Signed-off-by: Eric Blake <address@hidden>

Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>

> ---
>   nbd/client.c | 51 +++++++++++++++++++++++----------------------------
>   1 file changed, 23 insertions(+), 28 deletions(-)
> 
> diff --git a/nbd/client.c b/nbd/client.c
> index 27785c55d0a..1ed5009642e 100644
> --- a/nbd/client.c
> +++ b/nbd/client.c

[...]

>       trace_nbd_receive_negotiate_size_flags(info->size, info->flags);
>       if (zeroes && nbd_drop(ioc, 124, errp) < 0) {
>           error_prepend(errp, "Failed to read reserved block: ");
> -        goto fail;
> +        return -EINVAL;
>       }
> -    rc = 0;
> -

hmm, personally I like this empty line

> -fail:
> -    return rc;
> +    return 0;
>   }
> 
>   #ifdef __linux__
> 


-- 
Best regards,
Vladimir

reply via email to

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