From: David Gibson <david@gibson.dropbear.id.au>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for 3.0] sm501: Fix warning about unreachable code
Date: Mon, 16 Jul 2018 11:19:32 +1000 [thread overview]
Message-ID: <20180716011932.GE2599@umbus.fritz.box> (raw)
In-Reply-To: <20180715211731.311B67456B5@zero.eik.bme.hu>
[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]
On Sun, Jul 15, 2018 at 10:59:21PM +0200, BALATON Zoltan wrote:
> Coverity warned that the false arm of conditional expression is
> unreachable when it is inside an if with the same condition.
> Remove the unreachable code to avoid the warning.
>
> Fixes: CID 1394215
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Applied to ppc-for-3.0, thanks.
> ---
> hw/display/sm501.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 9ab29d3..874260a 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -1024,7 +1024,7 @@ static void sm501_i2c_write(void *opaque, hwaddr addr, uint64_t value,
> if (res) {
> SM501_DPRINTF("sm501 i2c : transfer failed"
> " i=%d, res=%d\n", i, res);
> - s->i2c_status |= (res ? SM501_I2C_STATUS_ERROR : 0);
> + s->i2c_status |= SM501_I2C_STATUS_ERROR;
> return;
> }
> }
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-07-16 1:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-15 20:59 [Qemu-devel] [PATCH for 3.0] sm501: Fix warning about unreachable code BALATON Zoltan
2018-07-15 22:19 ` Philippe Mathieu-Daudé
2018-07-16 1:19 ` David Gibson [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=20180716011932.GE2599@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=balaton@eik.bme.hu \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@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).