From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROx2S-0003RH-LU for qemu-devel@nongnu.org; Fri, 11 Nov 2011 14:45:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROx2R-00021a-3U for qemu-devel@nongnu.org; Fri, 11 Nov 2011 14:45:24 -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 1ROx2Q-0001is-W0 for qemu-devel@nongnu.org; Fri, 11 Nov 2011 14:45:23 -0500 Received: by mail-iy0-f173.google.com with SMTP id k32so5202243iak.4 for ; Fri, 11 Nov 2011 11:45:22 -0800 (PST) Message-ID: <4EBD7B4F.7050908@codemonkey.ws> Date: Fri, 11 Nov 2011 13:45:19 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1320869094-10215-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1320869094-10215-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/pl061: Remove pointless comparison of array to null 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:04 PM, Peter Maydell wrote: > Remove a pointless comparison of an array to null. (There is > no need to check whether s->out[i] is non-null as qemu_set_irq > will do that for us.) Spotted by Coverity (see bug 887883). > > Signed-off-by: Peter Maydell Applied. Thanks. Regards, Anthony Liguori > --- > hw/pl061.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/hw/pl061.c b/hw/pl061.c > index d13746c..cf5adbe 100644 > --- a/hw/pl061.c > +++ b/hw/pl061.c > @@ -103,7 +103,7 @@ static void pl061_update(pl061_state *s) > s->old_data = out; > for (i = 0; i< 8; i++) { > mask = 1<< i; > - if ((changed& mask)&& s->out) { > + if (changed& mask) { > DPRINTF("Set output %d = %d\n", i, (out& mask) != 0); > qemu_set_irq(s->out[i], (out& mask) != 0); > }