qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Elena Afanasova <eafanasova@gmail.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [PATCH] block/qcow2-cluster: remove dead code
Date: Thu, 15 Oct 2020 14:45:22 +0200	[thread overview]
Message-ID: <20201015124522.GJ4610@merkur.fritz.box> (raw)
In-Reply-To: <e04b538ddbf6b6612c0c94602740ff78a98812d7.camel@gmail.com>

Am 15.10.2020 um 14:13 hat Elena Afanasova geschrieben:
> Since handle_dependencies() returns 0 or -EAGAIN the following case can be removed.
> Spotted by PVS-Studio.
> 
> Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
> ---
>  block/qcow2-cluster.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
> index aa87d3e99b..e2e0db0cc9 100644
> --- a/block/qcow2-cluster.c
> +++ b/block/qcow2-cluster.c
> @@ -1806,8 +1806,6 @@ again:
>               * structs before starting over. */
>              assert(*m == NULL);
>              goto again;
> -        } else if (ret < 0) {
> -            return ret;
>          } else if (cur_bytes == 0) {
>              break;
>          } else {

Technically correct, but let's keep it for anyone who will return a
different error code in the future. I think we should always check for
any error even if it is currently not produced.

Kevin



      reply	other threads:[~2020-10-15 12:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 12:13 [PATCH] block/qcow2-cluster: remove dead code Elena Afanasova
2020-10-15 12:45 ` Kevin Wolf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201015124522.GJ4610@merkur.fritz.box \
    --to=kwolf@redhat.com \
    --cc=eafanasova@gmail.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).