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: 124630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0CE34B6F65 for ; Thu, 10 Nov 2011 04:20:40 +1100 (EST) Received: from localhost ([::1]:53548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROBpD-0007gY-8L for incoming@patchwork.ozlabs.org; Wed, 09 Nov 2011 12:20:35 -0500 Received: from eggs.gnu.org ([140.186.70.92]:54914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROBp4-0007fO-7P for qemu-devel@nongnu.org; Wed, 09 Nov 2011 12:20:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROBot-0004BZ-Gw for qemu-devel@nongnu.org; Wed, 09 Nov 2011 12:20:26 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:48792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROBot-000495-AE for qemu-devel@nongnu.org; Wed, 09 Nov 2011 12:20:15 -0500 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 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: patches@linaro.org Subject: [Qemu-devel] [PATCH] hw/omap_dss.c: Fix !-vs-~ bug in handling DISPC_CONTROL X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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