From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvoG7-00041X-J9 for qemu-devel@nongnu.org; Thu, 17 Jan 2013 07:07:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvoG6-0005HD-ML for qemu-devel@nongnu.org; Thu, 17 Jan 2013 07:07:51 -0500 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:45513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvoG6-0005Gp-G6 for qemu-devel@nongnu.org; Thu, 17 Jan 2013 07:07:50 -0500 Received: from blackfin.pond.sub.org (p5B32B530.dip.t-dialin.net [91.50.181.48]) by oxygen.pond.sub.org (Postfix) with ESMTPA id CA4639FE57 for ; Thu, 17 Jan 2013 13:07:48 +0100 (CET) From: Markus Armbruster Date: Thu, 17 Jan 2013 13:07:47 +0100 Message-Id: <1358424467-15293-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH] scsi: Drop useless null test in scsi_unit_attention() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com req was created by scsi_req_alloc(), which initializes req->dev to a value it dereferences. req->dev isn't changed anywhere else. Therefore, req->dev can't be null. Drop the useless null test; it spooks Coverity. Signed-off-by: Markus Armbruster --- hw/scsi-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 267a942..a97f1cd 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -282,7 +282,7 @@ static const struct SCSIReqOps reqops_invalid_opcode = { static int32_t scsi_unit_attention(SCSIRequest *req, uint8_t *buf) { - if (req->dev && req->dev->unit_attention.key == UNIT_ATTENTION) { + if (req->dev->unit_attention.key == UNIT_ATTENTION) { scsi_req_build_sense(req, req->dev->unit_attention); } else if (req->bus->unit_attention.key == UNIT_ATTENTION) { scsi_req_build_sense(req, req->bus->unit_attention); -- 1.7.11.7