From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROE54-0004j6-QH for qemu-devel@nongnu.org; Wed, 09 Nov 2011 14:45:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROE53-0000e7-JA for qemu-devel@nongnu.org; Wed, 09 Nov 2011 14:45:06 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:46493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROE53-0000b2-B2 for qemu-devel@nongnu.org; Wed, 09 Nov 2011 14:45:05 -0500 Received: by mail-iy0-f173.google.com with SMTP id k32so2360764iak.4 for ; Wed, 09 Nov 2011 11:45:05 -0800 (PST) Message-ID: <4EBAD83E.4000304@codemonkey.ws> Date: Wed, 09 Nov 2011 13:45:02 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1320859206-9507-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1320859206-9507-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/omap_dss.c: Fix !-vs-~ bug in handling DISPC_CONTROL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, patches@linaro.org On 11/09/2011 11:20 AM, Peter Maydell wrote: > 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 Applied. Thanks. Regards, Anthony Liguori > --- > 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