Skip to contentSkip to conversation

hw/omap_dss.c: Fix !-vs-~ bug in handling DISPC_CONTROL

PATCH Applied Peter Maydell 2 participants 2 messages Nov 9, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
The significant change is s/~/!/, the rest is fixing stuff that would otherwise make checkpatch complain (braces, indent, __FUNCTION__).

 hw/omap_dss.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
hw/omap_dss.c +5 -4
index c8387a8..b4a8b4c 100644
@@ -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
Signature · 1 line
1.7.1
#1 lore raw
Quoted 5 lines · Peter Maydell

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.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 27 lines

---
The significant change is s/~/!/, the rest is fixing stuff that would otherwise make checkpatch complain (braces, indent, __FUNCTION__).

  hw/omap_dss.c |    9 +++++----
  1 files changed, 5 insertions(+), 4 deletions(-)
hw/omap_dss.c +5 -4
index c8387a8..b4a8b4c 100644
@@ -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