Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753145AbaA3OYK (ORCPT ); Thu, 30 Jan 2014 09:24:10 -0500 Received: from mail-ie0-f182.google.com ([209.85.223.182]:48912 "EHLO mail-ie0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752572AbaA3OYJ (ORCPT ); Thu, 30 Jan 2014 09:24:09 -0500 From: "Steven J. Magnani" To: "James E.J. Bottomley" Cc: Andrew Vasquez , linux-driver@qlogic.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, "Steven J. Magnani" Subject: [PATCH] qla2xxx: eliminate dead code in qla24xx_process_bidir_cmd Date: Thu, 30 Jan 2014 08:17:55 -0600 Message-Id: <1391091475-15629-1-git-send-email-steve@digidescorp.com> X-Mailer: git-send-email 1.6.0.6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Coverity reports that the test of req_data_len vs. rsp_data_len is dead code. This appears to be because the test occurs before any real assignment to either variable. Assuming that the sole in-tree execution path (QL_VND_DIAG_IO_CMD submitted via FC pass-through on a host /dev/bsg/X) does not require the response to have the same length as the request, all code related to the faulty test can be removed. If this is not the case, the test should be moved much earlier in the function since it does not depend on any resource acquitision. Signed-off-by: Steven J. Magnani --- --- linux-3.13/drivers/scsi/qla2xxx/qla_bsg.c 2014-01-29 13:50:02.050802907 -0600 +++ b/drivers/scsi/qla2xxx/qla_bsg.c 2014-01-29 13:53:15.856549874 -0600 @@ -1732,8 +1732,6 @@ qla24xx_process_bidir_cmd(struct fc_bsg_ uint16_t nextlid = 0; uint32_t tot_dsds; srb_t *sp = NULL; - uint32_t req_data_len = 0; - uint32_t rsp_data_len = 0; /* Check the type of the adapter */ if (!IS_BIDI_CAPABLE(ha)) { @@ -1840,17 +1838,6 @@ qla24xx_process_bidir_cmd(struct fc_bsg_ goto done_unmap_sg; } - if (req_data_len != rsp_data_len) { - rval = EXT_STATUS_BUSY; - ql_log(ql_log_warn, vha, 0x70aa, - "req_data_len != rsp_data_len\n"); - goto done_unmap_sg; - } - - req_data_len = bsg_job->request_payload.payload_len; - rsp_data_len = bsg_job->reply_payload.payload_len; - - /* Alloc SRB structure */ sp = qla2x00_get_sp(vha, &(vha->bidir_fcport), GFP_KERNEL); if (!sp) { --- linux-3.13/drivers/scsi/qla2xxx/qla_dbg.c 2014-01-29 13:50:49.435230824 -0600 +++ b/drivers/scsi/qla2xxx/qla_dbg.c 2014-01-29 13:53:43.960820829 -0600 @@ -38,7 +38,8 @@ * | | | 0x7073-0x7075, | * | | | 0x707b,0x708c, | * | | | 0x70a5,0x70a6, | - * | | | 0x70a8,0x70ab, | + * | | | 0x70a8, | + * | | | 0x70aa-0x70ab, | * | | | 0x70ad-0x70ae, | * | | | 0x70d1-0x70db, | * | | | 0x7047,0x703b | -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/