From: "Steven J. Magnani" <steve.magnani@digidescorp.com>
To: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>,
linux-driver@qlogic.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Steven J. Magnani" <steve@digidescorp.com>
Subject: [PATCH] qla2xxx: eliminate dead code in qla24xx_process_bidir_cmd
Date: Thu, 30 Jan 2014 08:17:55 -0600 [thread overview]
Message-ID: <1391091475-15629-1-git-send-email-steve@digidescorp.com> (raw)
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 <steve@digidescorp.com>
---
--- 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 |
reply other threads:[~2014-01-30 14:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391091475-15629-1-git-send-email-steve@digidescorp.com \
--to=steve.magnani@digidescorp.com \
--cc=JBottomley@parallels.com \
--cc=andrew.vasquez@qlogic.com \
--cc=linux-driver@qlogic.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=steve@digidescorp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®