From: Bart Van Assche <bart.vanassche@sandisk.com>
To: James Bottomley <jbottomley@odin.com>
Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>,
Quinn Tran <quinn.tran@qlogic.com>,
Saurav Kashyap <saurav.kashyap@qlogic.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: [PATCH 09/10] qla2xxx: Comment out unreachable code
Date: Thu, 4 Jun 2015 15:57:20 -0700 [thread overview]
Message-ID: <5570D7D0.80500@sandisk.com> (raw)
In-Reply-To: <5570D656.9050704@sandisk.com>
Comment out the code that is never reached in qla83xx_idc_unlock()
and also in qlt_set_data_offset() to avoid that static source code
analysis tools report warnings for this code.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>
Cc: Quinn Tran <quinn.tran@qlogic.com>
Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
---
drivers/scsi/qla2xxx/qla_os.c | 7 ++++++-
drivers/scsi/qla2xxx/qla_target.c | 16 +++++++++-------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 0ababd5..5a5166b 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4417,7 +4417,10 @@ retry_lock2:
void
qla83xx_idc_unlock(scsi_qla_host_t *base_vha, uint16_t requester_id)
{
- uint16_t options = (requester_id << 15) | BIT_7, retry;
+#if 0
+ uint16_t options = (requester_id << 15) | BIT_7;
+#endif
+ uint16_t retry;
uint32_t data;
struct qla_hw_data *ha = base_vha->hw;
@@ -4453,6 +4456,7 @@ retry_unlock:
return;
+#if 0
/* XXX: IDC-unlock implementation using access-control mbx */
retry = 0;
retry_unlock2:
@@ -4468,6 +4472,7 @@ retry_unlock2:
}
return;
+#endif
}
int
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 59a0897..22a91a3 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -3699,6 +3699,14 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha,
static int qlt_set_data_offset(struct qla_tgt_cmd *cmd, uint32_t offset)
{
+#if 1
+ /*
+ * FIXME: Reject non zero SRR relative offset until we can test
+ * this code properly.
+ */
+ pr_debug("Rejecting non zero SRR rel_offs: %u\n", offset);
+ return -1;
+#else
struct scatterlist *sg, *sgp, *sg_srr, *sg_srr_start = NULL;
size_t first_offset = 0, rem_offset = offset, tmp = 0;
int i, sg_srr_cnt, bufflen = 0;
@@ -3708,13 +3716,6 @@ static int qlt_set_data_offset(struct qla_tgt_cmd *cmd, uint32_t offset)
"cmd->sg_cnt: %u, direction: %d\n",
cmd, cmd->sg, cmd->sg_cnt, cmd->dma_data_direction);
- /*
- * FIXME: Reject non zero SRR relative offset until we can test
- * this code properly.
- */
- pr_debug("Rejecting non zero SRR rel_offs: %u\n", offset);
- return -1;
-
if (!cmd->sg || !cmd->sg_cnt) {
ql_dbg(ql_dbg_tgt, cmd->vha, 0xe055,
"Missing cmd->sg or zero cmd->sg_cnt in"
@@ -3797,6 +3798,7 @@ static int qlt_set_data_offset(struct qla_tgt_cmd *cmd, uint32_t offset)
BUG();
return 0;
+#endif
}
static inline int qlt_srr_adjust_data(struct qla_tgt_cmd *cmd,
--
2.1.4
next prev parent reply other threads:[~2015-06-04 22:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 22:51 [PATCH v2 0/10] qla2xxx: Fix various warnings reported by static source code analysis tools Bart Van Assche
2015-06-04 22:52 ` [PATCH 01/10] qla2xxx: Declare local functions static Bart Van Assche
2015-06-04 22:53 ` [PATCH 02/10] qla2xxx: Remove set-but-not-used variables Bart Van Assche
2015-06-04 22:53 ` [PATCH 03/10] qla2xxx: Replace two macros with an inline function Bart Van Assche
2015-06-04 22:54 ` [PATCH 04/10] qla2xxx: Remove __constant_ prefix Bart Van Assche
2015-06-04 22:55 ` [PATCH 05/10] qla2xxx: Specify the [noderef] attribute once Bart Van Assche
2015-06-04 22:55 ` [PATCH 06/10] qla2xxx: Fix sparse annotations Bart Van Assche
2015-06-04 22:56 ` [PATCH 07/10] qla2xxx: Remove a superfluous test Bart Van Assche
2015-06-04 22:56 ` [PATCH 08/10] qla2xxx: Remove unreachable code Bart Van Assche
2015-06-04 22:57 ` Bart Van Assche [this message]
2015-06-11 4:43 ` [PATCH 09/10] qla2xxx: Comment out " Himanshu Madhani
2015-06-04 22:58 ` [PATCH 10/10] qla2xxx: Fix indentation Bart Van Assche
2015-06-11 4:45 ` Himanshu Madhani
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=5570D7D0.80500@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=himanshu.madhani@qlogic.com \
--cc=jbottomley@odin.com \
--cc=linux-scsi@vger.kernel.org \
--cc=quinn.tran@qlogic.com \
--cc=saurav.kashyap@qlogic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.