From: Lee Duncan <lduncan@suse.com>
To: Bart Van Assche <bvanassche@acm.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>
Cc: linux-scsi@vger.kernel.org, Quinn Tran <qutran@marvell.com>,
Mike Christie <michael.christie@oracle.com>,
Daniel Wagner <dwagner@suse.de>,
Himanshu Madhani <himanshu.madhani@oracle.com>
Subject: Re: [PATCH v2 5/6] qla2xxx: Simplify qla8044_minidump_process_control()
Date: Thu, 18 Mar 2021 09:03:05 -0700 [thread overview]
Message-ID: <7db3f9d2-e18d-cb0e-0366-79e2645a12af@suse.com> (raw)
In-Reply-To: <20210318032840.7611-6-bvanassche@acm.org>
On 3/17/21 8:28 PM, Bart Van Assche wrote:
> This patch fixes the following Coverity complaint:
>
> CID 177490 (#1 of 1): Unused value (UNUSED_VALUE)
> assigned_value: Assigning value from opcode & 0xffffff7fU to opcode
> here, but that stored value is overwritten before it can be used.
>
> Cc: Quinn Tran <qutran@marvell.com>
> Cc: Mike Christie <michael.christie@oracle.com>
> Reviewed-by: Daniel Wagner <dwagner@suse.de>
> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> drivers/scsi/qla2xxx/qla_nx2.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c
> index 68a16c95dcb7..792c55fcec8c 100644
> --- a/drivers/scsi/qla2xxx/qla_nx2.c
> +++ b/drivers/scsi/qla2xxx/qla_nx2.c
> @@ -2226,19 +2226,16 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
> if (opcode & QLA82XX_DBG_OPCODE_WR) {
> qla8044_wr_reg_indirect(vha, crb_addr,
> crb_entry->value_1);
> - opcode &= ~QLA82XX_DBG_OPCODE_WR;
> }
>
> if (opcode & QLA82XX_DBG_OPCODE_RW) {
> qla8044_rd_reg_indirect(vha, crb_addr, &read_value);
> qla8044_wr_reg_indirect(vha, crb_addr, read_value);
> - opcode &= ~QLA82XX_DBG_OPCODE_RW;
> }
>
> if (opcode & QLA82XX_DBG_OPCODE_AND) {
> qla8044_rd_reg_indirect(vha, crb_addr, &read_value);
> read_value &= crb_entry->value_2;
> - opcode &= ~QLA82XX_DBG_OPCODE_AND;
> if (opcode & QLA82XX_DBG_OPCODE_OR) {
> read_value |= crb_entry->value_3;
> opcode &= ~QLA82XX_DBG_OPCODE_OR;
> @@ -2249,7 +2246,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
> qla8044_rd_reg_indirect(vha, crb_addr, &read_value);
> read_value |= crb_entry->value_3;
> qla8044_wr_reg_indirect(vha, crb_addr, read_value);
> - opcode &= ~QLA82XX_DBG_OPCODE_OR;
> }
> if (opcode & QLA82XX_DBG_OPCODE_POLL) {
> poll_time = crb_entry->crb_strd.poll_timeout;
> @@ -2269,7 +2265,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
> crb_addr, &read_value);
> }
> } while (1);
> - opcode &= ~QLA82XX_DBG_OPCODE_POLL;
> }
>
> if (opcode & QLA82XX_DBG_OPCODE_RDSTATE) {
> @@ -2283,7 +2278,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
> qla8044_rd_reg_indirect(vha, addr, &read_value);
> index = crb_entry->crb_ctrl.state_index_v;
> tmplt_hdr->saved_state_array[index] = read_value;
> - opcode &= ~QLA82XX_DBG_OPCODE_RDSTATE;
> }
>
> if (opcode & QLA82XX_DBG_OPCODE_WRSTATE) {
> @@ -2303,7 +2297,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
> }
>
> qla8044_wr_reg_indirect(vha, addr, read_value);
> - opcode &= ~QLA82XX_DBG_OPCODE_WRSTATE;
> }
>
> if (opcode & QLA82XX_DBG_OPCODE_MDSTATE) {
> @@ -2316,7 +2309,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
> read_value |= crb_entry->value_3;
> read_value += crb_entry->value_1;
> tmplt_hdr->saved_state_array[index] = read_value;
> - opcode &= ~QLA82XX_DBG_OPCODE_MDSTATE;
> }
> crb_addr += crb_entry->crb_strd.addr_stride;
> }
>
Reviewed-by: Lee Duncan <lduncan@suse.com>
next prev parent reply other threads:[~2021-03-18 16:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 3:28 [PATCH v2 0/6] qla2xxx patches for kernel v5.12 and v5.13 Bart Van Assche
2021-03-18 3:28 ` [PATCH v2 1/6] Revert "qla2xxx: Make sure that aborted commands are freed" Bart Van Assche
2021-03-18 3:28 ` [PATCH v2 2/6] qla2xxx: Constify struct qla_tgt_func_tmpl Bart Van Assche
2021-03-18 16:01 ` Lee Duncan
2021-03-18 3:28 ` [PATCH v2 3/6] qla2xxx: Fix endianness annotations Bart Van Assche
2021-03-18 16:01 ` Lee Duncan
2021-03-18 3:28 ` [PATCH v2 4/6] qla2xxx: Suppress Coverity complaints about dseg_r* Bart Van Assche
2021-03-18 16:00 ` Lee Duncan
2021-03-18 19:10 ` Bart Van Assche
2021-03-18 3:28 ` [PATCH v2 5/6] qla2xxx: Simplify qla8044_minidump_process_control() Bart Van Assche
2021-03-18 16:03 ` Lee Duncan [this message]
2021-03-18 3:28 ` [PATCH v2 6/6] qla2xxx: Always check the return value of qla24xx_get_isp_stats() Bart Van Assche
2021-03-18 8:08 ` Daniel Wagner
2021-03-18 19:11 ` Bart Van Assche
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=7db3f9d2-e18d-cb0e-0366-79e2645a12af@suse.com \
--to=lduncan@suse.com \
--cc=bvanassche@acm.org \
--cc=dwagner@suse.de \
--cc=himanshu.madhani@oracle.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=qutran@marvell.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;
as well as URLs for NNTP newsgroup(s).