From: Michael Tokarev <mjt@tls.msk.ru>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-trivial <qemu-trivial@nongnu.org>,
Kevin Wolf <kwolf@redhat.com>, qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] block: Remove unused assignment (fixes warning from clang)
Date: Sun, 29 Sep 2013 23:44:37 +0400 [thread overview]
Message-ID: <52488325.5090702@msgid.tls.msk.ru> (raw)
In-Reply-To: <1380362114-29476-1-git-send-email-sw@weilnetz.de>
28.09.2013 13:55, Stefan Weil wrote:
> blockdev.c:1929:13: warning: Value stored to 'ret' is never read
> ret = 0;
> ^ ~
Applied to the trivial patches queue.
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
> blockdev.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/blockdev.c b/blockdev.c
> index 8aa66a9..8c83f6f 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -1926,7 +1926,6 @@ void qmp_drive_mirror(const char *device, const char *target,
> } else {
> switch (mode) {
> case NEW_IMAGE_MODE_EXISTING:
> - ret = 0;
> break;
While this one is obviously unused assignment,
there's on more usage of `ret' variable in this
function, -- it is to store the return value
from bdrv_open():
ret = bdrv_open(target_bs, target, NULL, flags | BDRV_O_NO_BACKING, drv,
&local_err);
if (ret < 0) {...
What's the rule about converting that into if() ?
Thanks,
/mjt
next prev parent reply other threads:[~2013-09-29 19:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-28 9:55 [Qemu-devel] [PATCH] block: Remove unused assignment (fixes warning from clang) Stefan Weil
2013-09-29 19:44 ` Michael Tokarev [this message]
2013-09-29 20:15 ` [Qemu-devel] [Qemu-trivial] " Stefan Weil
2013-09-30 7:57 ` Kevin Wolf
2013-09-30 9:16 ` Stefan Hajnoczi
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=52488325.5090702@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
/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).