[PATCH 079/117] pmcraid: Convert to the scsi_status union

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



An explanation of the purpose of this patch is available in the patch
"scsi: Introduce the scsi_status union".

Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
 drivers/scsi/pmcraid.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index bffd9a9349e7..2f8fb2717696 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -822,7 +822,7 @@ static void pmcraid_erp_done(struct pmcraid_cmd *cmd)
 	u32 ioasc = le32_to_cpu(cmd->ioa_cb->ioasa.ioasc);
 
 	if (PMCRAID_IOASC_SENSE_KEY(ioasc) > 0) {
-		scsi_cmd->result |= (DID_ERROR << 16);
+		scsi_cmd->status.combined |= (DID_ERROR << 16);
 		scmd_printk(KERN_INFO, scsi_cmd,
 			    "command CDB[0] = %x failed with IOASC: 0x%08X\n",
 			    cmd->ioa_cb->ioarcb.cdb[0], ioasc);
@@ -2008,7 +2008,7 @@ static void pmcraid_fail_outstanding_cmds(struct pmcraid_instance *pinstance)
 			struct scsi_cmnd *scsi_cmd = cmd->scsi_cmd;
 			__le32 resp = cmd->ioa_cb->ioarcb.response_handle;
 
-			scsi_cmd->result |= DID_ERROR << 16;
+			scsi_cmd->status.combined |= DID_ERROR << 16;
 
 			scsi_dma_unmap(scsi_cmd);
 			pmcraid_return_cmd(cmd);
@@ -2016,7 +2016,7 @@ static void pmcraid_fail_outstanding_cmds(struct pmcraid_instance *pinstance)
 			pmcraid_info("failing(%d) CDB[0] = %x result: %x\n",
 				     le32_to_cpu(resp) >> 2,
 				     cmd->ioa_cb->ioarcb.cdb[0],
-				     scsi_cmd->result);
+				     scsi_cmd->status.combined);
 			scsi_cmd->scsi_done(scsi_cmd);
 		} else if (cmd->cmd_done == pmcraid_internal_done ||
 			   cmd->cmd_done == pmcraid_erp_done) {
@@ -2510,7 +2510,7 @@ static void pmcraid_frame_auto_sense(struct pmcraid_cmd *cmd)
 	u32 failing_lba = 0;
 
 	memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE);
-	cmd->scsi_cmd->result = SAM_STAT_CHECK_CONDITION;
+	cmd->scsi_cmd->status.combined = SAM_STAT_CHECK_CONDITION;
 
 	if (RES_IS_VSET(res->cfg_entry) &&
 	    ioasc == PMCRAID_IOASC_ME_READ_ERROR_NO_REALLOC &&
@@ -2605,21 +2605,21 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd)
 	switch (masked_ioasc) {
 
 	case PMCRAID_IOASC_AC_TERMINATED_BY_HOST:
-		scsi_cmd->result |= (DID_ABORT << 16);
+		scsi_cmd->status.combined |= (DID_ABORT << 16);
 		break;
 
 	case PMCRAID_IOASC_IR_INVALID_RESOURCE_HANDLE:
 	case PMCRAID_IOASC_HW_CANNOT_COMMUNICATE:
-		scsi_cmd->result |= (DID_NO_CONNECT << 16);
+		scsi_cmd->status.combined |= (DID_NO_CONNECT << 16);
 		break;
 
 	case PMCRAID_IOASC_NR_SYNC_REQUIRED:
 		res->sync_reqd = 1;
-		scsi_cmd->result |= (DID_IMM_RETRY << 16);
+		scsi_cmd->status.combined |= (DID_IMM_RETRY << 16);
 		break;
 
 	case PMCRAID_IOASC_ME_READ_ERROR_NO_REALLOC:
-		scsi_cmd->result |= (DID_PASSTHROUGH << 16);
+		scsi_cmd->status.combined |= (DID_PASSTHROUGH << 16);
 		break;
 
 	case PMCRAID_IOASC_UA_BUS_WAS_RESET:
@@ -2627,11 +2627,11 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd)
 		if (!res->reset_progress)
 			scsi_report_bus_reset(pinstance->host,
 					      scsi_cmd->device->channel);
-		scsi_cmd->result |= (DID_ERROR << 16);
+		scsi_cmd->status.combined |= (DID_ERROR << 16);
 		break;
 
 	case PMCRAID_IOASC_HW_DEVICE_BUS_STATUS_ERROR:
-		scsi_cmd->result |= PMCRAID_IOASC_SENSE_STATUS(ioasc);
+		scsi_cmd->status.combined |= PMCRAID_IOASC_SENSE_STATUS(ioasc);
 		res->sync_reqd = 1;
 
 		/* if check_condition is not active return with error otherwise
@@ -2670,7 +2670,7 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd)
 
 	default:
 		if (PMCRAID_IOASC_SENSE_KEY(ioasc) > RECOVERED_ERROR)
-			scsi_cmd->result |= (DID_ERROR << 16);
+			scsi_cmd->status.combined |= (DID_ERROR << 16);
 		break;
 	}
 	return 0;
@@ -2807,7 +2807,7 @@ static int _pmcraid_io_done(struct pmcraid_cmd *cmd, int reslen, int ioasc)
 	pmcraid_info("response(%d) CDB[0] = %x ioasc:result: %x:%x\n",
 		le32_to_cpu(cmd->ioa_cb->ioarcb.response_handle) >> 2,
 		cmd->ioa_cb->ioarcb.cdb[0],
-		ioasc, scsi_cmd->result);
+		ioasc, scsi_cmd->status.combined);
 
 	if (PMCRAID_IOASC_SENSE_KEY(ioasc) != 0)
 		rc = pmcraid_error_handler(cmd);
@@ -3330,14 +3330,14 @@ static int pmcraid_queuecommand_lck(
 	fw_version = be16_to_cpu(pinstance->inq_data->fw_version);
 	scsi_cmd->scsi_done = done;
 	res = scsi_cmd->device->hostdata;
-	scsi_cmd->result = (DID_OK << 16);
+	scsi_cmd->status.combined = (DID_OK << 16);
 
 	/* if adapter is marked as dead, set result to DID_NO_CONNECT complete
 	 * the command
 	 */
 	if (pinstance->ioa_state == IOA_STATE_DEAD) {
 		pmcraid_info("IOA is dead, but queuecommand is scheduled\n");
-		scsi_cmd->result = (DID_NO_CONNECT << 16);
+		scsi_cmd->status.combined = (DID_NO_CONNECT << 16);
 		scsi_cmd->scsi_done(scsi_cmd);
 		return 0;
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux