From: Peter Maydell Date: Wed, 9 Nov 2011 17:20:06 +0000 (+0000) Subject: hw/omap_dss.c: Fix !-vs-~ bug in handling DISPC_CONTROL X-Git-Tag: v1.0-rc2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95117be5a337d15555b69b7059d4e0791ce8063d;p=thirdparty%2Fqemu.git hw/omap_dss.c: Fix !-vs-~ bug in handling DISPC_CONTROL Fix a bug revealed by a coverity scan (see bug 887883) which meant that we would never print the warning about unpredictable behaviour if a nonexistent overlay is enabled. Signed-off-by: Peter Maydell Signed-off-by: Anthony Liguori --- diff --git a/hw/omap_dss.c b/hw/omap_dss.c index c8387a8cc1b..b4a8b4c45d4 100644 --- a/hw/omap_dss.c +++ b/hw/omap_dss.c @@ -389,10 +389,11 @@ static void omap_disc_write(void *opaque, target_phys_addr_t addr, s->dig.enable = (value >> 1) & 1; s->lcd.enable = (value >> 0) & 1; if (value & (1 << 12)) /* OVERLAY_OPTIMIZATION */ - if (~((s->dispc.l[1].attr | s->dispc.l[2].attr) & 1)) - fprintf(stderr, "%s: Overlay Optimization when no overlay " - "region effectively exists leads to " - "unpredictable behaviour!\n", __FUNCTION__); + if (!((s->dispc.l[1].attr | s->dispc.l[2].attr) & 1)) { + fprintf(stderr, "%s: Overlay Optimization when no overlay " + "region effectively exists leads to " + "unpredictable behaviour!\n", __func__); + } if (value & (1 << 6)) { /* GODIGITAL */ /* XXX: Shadowed fields are: * s->dispc.config