Received: from eggs.gnu.org ([2001:4830:134:3::10]:59637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO6DY-0007Zj-Li for qemu-devel@nongnu.org; Fri, 15 Jul 2016 12:44:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO6DU-0007OT-BB for qemu-devel@nongnu.org; Fri, 15 Jul 2016 12:43:59 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO6DU-0007ON-4R for qemu-devel@nongnu.org; Fri, 15 Jul 2016 12:43:56 -0400 Received: by mail-wm0-x241.google.com with SMTP id o80so2873361wme.0 for ; Fri, 15 Jul 2016 09:43:55 -0700 (PDT) Received: from donizetti.localdomain ([81.123.183.255]) by smtp.gmail.com with ESMTPSA id p2sm1572337wjm.23.2016.07.15.09.43.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2016 09:43:54 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 15 Jul 2016 18:43:50 +0200 Message-Id: <1468601030-5648-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] megasas: remove useless check for cmd->frame List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org megasas_enqueue_frame always returns with non-NULL cmd->frame. Remove the "else" part as it is dead code. Signed-off-by: Paolo Bonzini --- hw/scsi/megasas.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 52a4123..e968302 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -1981,11 +1981,7 @@ static void megasas_handle_frame(MegasasState *s, uint64_t frame_addr, break; } if (frame_status != MFI_STAT_INVALID_STATUS) { - if (cmd->frame) { - cmd->frame->header.cmd_status = frame_status; - } else { - megasas_frame_set_cmd_status(s, frame_addr, frame_status); - } + cmd->frame->header.cmd_status = frame_status; megasas_unmap_frame(s, cmd); megasas_complete_frame(s, cmd->context); } -- 2.7.4