From patchwork Wed Nov 9 17:20:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 4982 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 765EB23E04 for ; Wed, 9 Nov 2011 17:20:11 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 61EADA1889C for ; Wed, 9 Nov 2011 17:20:11 +0000 (UTC) Received: by faan26 with SMTP id n26so2674260faa.11 for ; Wed, 09 Nov 2011 09:20:11 -0800 (PST) Received: by 10.152.102.138 with SMTP id fo10mr2142605lab.44.1320859211067; Wed, 09 Nov 2011 09:20:11 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.10.72 with SMTP id g8cs178971lab; Wed, 9 Nov 2011 09:20:10 -0800 (PST) Received: by 10.227.204.135 with SMTP id fm7mr2517627wbb.2.1320859208895; Wed, 09 Nov 2011 09:20:08 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id ey3si3096731wbb.134.2011.11.09.09.20.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 09:20:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1ROBok-0002Tm-35; Wed, 09 Nov 2011 17:20:06 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Andrzej Zaborowski Subject: [PATCH] hw/omap_dss.c: Fix !-vs-~ bug in handling DISPC_CONTROL Date: Wed, 9 Nov 2011 17:20:06 +0000 Message-Id: <1320859206-9507-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 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 --- 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(-) diff --git a/hw/omap_dss.c b/hw/omap_dss.c index c8387a8..b4a8b4c 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