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: 124693 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 45467B6F18 for ; Thu, 10 Nov 2011 07:05:11 +1100 (EST) Received: from localhost ([::1]:36992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROEOO-000614-IO for incoming@patchwork.ozlabs.org; Wed, 09 Nov 2011 15:05:04 -0500 Received: from eggs.gnu.org ([140.186.70.92]:38372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROEOI-00060o-L7 for qemu-devel@nongnu.org; Wed, 09 Nov 2011 15:04:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROEOH-0004jr-IT for qemu-devel@nongnu.org; Wed, 09 Nov 2011 15:04:58 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:59540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROEOH-0004jk-B3 for qemu-devel@nongnu.org; Wed, 09 Nov 2011 15:04:57 -0500 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 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 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/pl061: Remove pointless comparison of array to null 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 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); }