From patchwork Wed Nov 9 20:04:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 5006 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 6857623E13 for ; Wed, 9 Nov 2011 20:04:59 +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 4C837A18127 for ; Wed, 9 Nov 2011 20:04:59 +0000 (UTC) Received: by faan26 with SMTP id n26so2927679faa.11 for ; Wed, 09 Nov 2011 12:04:59 -0800 (PST) Received: by 10.152.105.83 with SMTP id gk19mr2600691lab.30.1320869098805; Wed, 09 Nov 2011 12:04:58 -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 g8cs185114lab; Wed, 9 Nov 2011 12:04:58 -0800 (PST) Received: by 10.216.206.138 with SMTP id l10mr702015weo.14.1320869096936; Wed, 09 Nov 2011 12:04:56 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id t1si3360682weq.127.2011.11.09.12.04.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 12:04:56 -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 1ROEOE-0002fC-QJ; Wed, 09 Nov 2011 20:04:54 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH] hw/pl061: Remove pointless comparison of array to null Date: Wed, 9 Nov 2011 20:04:54 +0000 Message-Id: <1320869094-10215-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 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 --- 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); }