Commit a20821e3 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: qla2xxx: Simplify qla8044_minidump_process_control()

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.

Link: https://lore.kernel.org/r/20210320232359.941-6-bvanassche@acm.org
Cc: Quinn Tran <qutran@marvell.com>
Cc: Mike Christie <michael.christie@oracle.com>
Reviewed-by: default avatarDaniel Wagner <dwagner@suse.de>
Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: default avatarLee Duncan <lduncan@suse.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 17603237
...@@ -2226,19 +2226,16 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, ...@@ -2226,19 +2226,16 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
if (opcode & QLA82XX_DBG_OPCODE_WR) { if (opcode & QLA82XX_DBG_OPCODE_WR) {
qla8044_wr_reg_indirect(vha, crb_addr, qla8044_wr_reg_indirect(vha, crb_addr,
crb_entry->value_1); crb_entry->value_1);
opcode &= ~QLA82XX_DBG_OPCODE_WR;
} }
if (opcode & QLA82XX_DBG_OPCODE_RW) { if (opcode & QLA82XX_DBG_OPCODE_RW) {
qla8044_rd_reg_indirect(vha, crb_addr, &read_value); qla8044_rd_reg_indirect(vha, crb_addr, &read_value);
qla8044_wr_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) { if (opcode & QLA82XX_DBG_OPCODE_AND) {
qla8044_rd_reg_indirect(vha, crb_addr, &read_value); qla8044_rd_reg_indirect(vha, crb_addr, &read_value);
read_value &= crb_entry->value_2; read_value &= crb_entry->value_2;
opcode &= ~QLA82XX_DBG_OPCODE_AND;
if (opcode & QLA82XX_DBG_OPCODE_OR) { if (opcode & QLA82XX_DBG_OPCODE_OR) {
read_value |= crb_entry->value_3; read_value |= crb_entry->value_3;
opcode &= ~QLA82XX_DBG_OPCODE_OR; opcode &= ~QLA82XX_DBG_OPCODE_OR;
...@@ -2249,7 +2246,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, ...@@ -2249,7 +2246,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
qla8044_rd_reg_indirect(vha, crb_addr, &read_value); qla8044_rd_reg_indirect(vha, crb_addr, &read_value);
read_value |= crb_entry->value_3; read_value |= crb_entry->value_3;
qla8044_wr_reg_indirect(vha, crb_addr, read_value); qla8044_wr_reg_indirect(vha, crb_addr, read_value);
opcode &= ~QLA82XX_DBG_OPCODE_OR;
} }
if (opcode & QLA82XX_DBG_OPCODE_POLL) { if (opcode & QLA82XX_DBG_OPCODE_POLL) {
poll_time = crb_entry->crb_strd.poll_timeout; poll_time = crb_entry->crb_strd.poll_timeout;
...@@ -2269,7 +2265,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, ...@@ -2269,7 +2265,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
crb_addr, &read_value); crb_addr, &read_value);
} }
} while (1); } while (1);
opcode &= ~QLA82XX_DBG_OPCODE_POLL;
} }
if (opcode & QLA82XX_DBG_OPCODE_RDSTATE) { if (opcode & QLA82XX_DBG_OPCODE_RDSTATE) {
...@@ -2283,7 +2278,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, ...@@ -2283,7 +2278,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
qla8044_rd_reg_indirect(vha, addr, &read_value); qla8044_rd_reg_indirect(vha, addr, &read_value);
index = crb_entry->crb_ctrl.state_index_v; index = crb_entry->crb_ctrl.state_index_v;
tmplt_hdr->saved_state_array[index] = read_value; tmplt_hdr->saved_state_array[index] = read_value;
opcode &= ~QLA82XX_DBG_OPCODE_RDSTATE;
} }
if (opcode & QLA82XX_DBG_OPCODE_WRSTATE) { if (opcode & QLA82XX_DBG_OPCODE_WRSTATE) {
...@@ -2303,7 +2297,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, ...@@ -2303,7 +2297,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
} }
qla8044_wr_reg_indirect(vha, addr, read_value); qla8044_wr_reg_indirect(vha, addr, read_value);
opcode &= ~QLA82XX_DBG_OPCODE_WRSTATE;
} }
if (opcode & QLA82XX_DBG_OPCODE_MDSTATE) { if (opcode & QLA82XX_DBG_OPCODE_MDSTATE) {
...@@ -2316,7 +2309,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, ...@@ -2316,7 +2309,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha,
read_value |= crb_entry->value_3; read_value |= crb_entry->value_3;
read_value += crb_entry->value_1; read_value += crb_entry->value_1;
tmplt_hdr->saved_state_array[index] = read_value; tmplt_hdr->saved_state_array[index] = read_value;
opcode &= ~QLA82XX_DBG_OPCODE_MDSTATE;
} }
crb_addr += crb_entry->crb_strd.addr_stride; crb_addr += crb_entry->crb_strd.addr_stride;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment