Skip to contentSkip to conversation

qla2xxx: eliminate dead code in qla24xx_process_bidir_cmd

PATCH New Steven J. Magnani 1 participant 1 message Jan 30, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qla2xxx: eliminate dead code in qla24xx_process_bidir_cmd

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.

---

drivers/scsi/qla2xxx/qla_bsg.c +0 -13
@@ -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) {
drivers/scsi/qla2xxx/qla_dbg.c +2 -1
@@ -38,7 +38,8 @@
  * |                              |                    | 0x7073-0x7075, |
  * |                              |                    | 0x707b,0x708c, |
  * |                              |                    | 0x70a5,0x70a6, |
- * |                              |                    | 0x70a8,0x70ab, |
+ * |                              |                    | 0x70a8,        |
+ * |                              |                    | 0x70aa-0x70ab, |
  * |                              |                    | 0x70ad-0x70ae, |
  * |                              |                    | 0x70d1-0x70db, |
  * |                              |                    | 0x7047,0x703b	|