]> git.proxmox.com Git - mirror_qemu.git/commitdiff
sm501: Fix warning about unreachable code
authorBALATON Zoltan <balaton@eik.bme.hu>
Sun, 15 Jul 2018 20:59:21 +0000 (22:59 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 16 Jul 2018 01:19:10 +0000 (11:19 +1000)
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>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/display/sm501.c

index 9ab29d35dd8a99b83e217dd6edaced4f6650cfec..874260a143a6c0385d3960744ac7b0a6673af12b 100644 (file)
@@ -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;
                         }
                     }