From: BALATON Zoltan Date: Sun, 15 Jul 2018 20:59:21 +0000 (+0200) Subject: sm501: Fix warning about unreachable code X-Git-Tag: v3.0.0-rc1~22^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6730df0514d3aec35e646ff9833fbe8b05fd0776;p=thirdparty%2Fqemu.git sm501: Fix warning about unreachable code 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 Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 9ab29d35dd8..874260a143a 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; } }