From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROx2m-0004Kl-Fw for qemu-devel@nongnu.org; Fri, 11 Nov 2011 14:45:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROx2f-00026Q-WF for qemu-devel@nongnu.org; Fri, 11 Nov 2011 14:45:39 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:35059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROx2f-0001is-T8 for qemu-devel@nongnu.org; Fri, 11 Nov 2011 14:45:37 -0500 Received: by mail-iy0-f173.google.com with SMTP id k32so5202243iak.4 for ; Fri, 11 Nov 2011 11:45:37 -0800 (PST) Message-ID: <4EBD7B5E.8070607@codemonkey.ws> Date: Fri, 11 Nov 2011 13:45:34 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1320871595-10304-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1320871595-10304-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/pxa2xx.c: Fix handling of R/WC bits in PMCR 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 02:46 PM, Peter Maydell wrote: > Fix a bug in handling the write-one-to-clear bits in the PMCR > which meant that we would always clear the bit even if the > value written was a zero. Spotted by Coverity (see bug 887883). > > Signed-off-by: Peter Maydell Applied. Thanks. Regards, Anthony Liguori > --- > hw/pxa2xx.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c > index bfc28a9..d38b922 100644 > --- a/hw/pxa2xx.c > +++ b/hw/pxa2xx.c > @@ -114,7 +114,9 @@ static void pxa2xx_pm_write(void *opaque, target_phys_addr_t addr, > > switch (addr) { > case PMCR: > - s->pm_regs[addr>> 2]&= 0x15& ~(value& 0x2a); > + /* Clear the write-one-to-clear bits... */ > + s->pm_regs[addr>> 2]&= ~(value& 0x2a); > + /* ...and set the plain r/w bits */ > s->pm_regs[addr>> 2] |= value& 0x15; > break; >