summaryrefslogtreecommitdiff
path: root/hw/omap_dss.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-11-09 17:20:06 +0000
committerAnthony Liguori <aliguori@us.ibm.com>2011-11-09 12:06:20 -0600
commit95117be5a337d15555b69b7059d4e0791ce8063d (patch)
tree8ed9844894ba163c77f014d60329d5276dd01a58 /hw/omap_dss.c
parent66e3dd9282141b5ae75637c9676002cf3ceeb988 (diff)
downloadqemu-95117be5a337d15555b69b7059d4e0791ce8063d.tar.gz
qemu-95117be5a337d15555b69b7059d4e0791ce8063d.tar.bz2
qemu-95117be5a337d15555b69b7059d4e0791ce8063d.zip
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 <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/omap_dss.c')
-rw-r--r--hw/omap_dss.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/omap_dss.c b/hw/omap_dss.c
index c8387a8cc1..b4a8b4c45d 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