@@ -398,7 +398,7 @@ static struct status_msg *stex_get_status(struct st_hba *hba)
static void stex_invalid_field(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *))
{
- cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
+ cmd->status.combined = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
/* "Invalid field in cdb" */
scsi_build_sense_buffer(0, cmd->sense_buffer, ILLEGAL_REQUEST, 0x24,
@@ -576,7 +576,7 @@ static void return_abnormal_state(struct st_hba *hba, int status)
ccb->req = NULL;
if (ccb->cmd) {
scsi_dma_unmap(ccb->cmd);
- ccb->cmd->result = status << 16;
+ ccb->cmd->status.combined = status << 16;
ccb->cmd->scsi_done(ccb->cmd);
ccb->cmd = NULL;
}
@@ -607,7 +607,7 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
lun = cmd->device->lun;
hba = (struct st_hba *) &host->hostdata[0];
if (hba->mu_status == MU_STATE_NOCONNECT) {
- cmd->result = DID_NO_CONNECT;
+ cmd->status.combined = DID_NO_CONNECT;
done(cmd);
return 0;
}
@@ -625,7 +625,7 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
if (page == 0x8 || page == 0x3f) {
scsi_sg_copy_from_buffer(cmd, ms10_caching_page,
sizeof(ms10_caching_page));
- cmd->result = DID_OK << 16;
+ cmd->status.combined = DID_OK << 16;
done(cmd);
} else
stex_invalid_field(cmd, done);
@@ -644,14 +644,14 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
break;
case TEST_UNIT_READY:
if (id == host->max_id - 1) {
- cmd->result = DID_OK << 16;
+ cmd->status.combined = DID_OK << 16;
done(cmd);
return 0;
}
break;
case INQUIRY:
if (lun >= host->max_lun) {
- cmd->result = DID_NO_CONNECT << 16;
+ cmd->status.combined = DID_NO_CONNECT << 16;
done(cmd);
return 0;
}
@@ -661,7 +661,7 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
(cmd->cmnd[1] & INQUIRY_EVPD) == 0) {
scsi_sg_copy_from_buffer(cmd, (void *)console_inq_page,
sizeof(console_inq_page));
- cmd->result = DID_OK << 16;
+ cmd->status.combined = DID_OK << 16;
done(cmd);
} else
stex_invalid_field(cmd, done);
@@ -680,9 +680,9 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
ver.host_no = hba->host->host_no;
cp_len = scsi_sg_copy_from_buffer(cmd, &ver, cp_len);
if (sizeof(ver) == cp_len)
- cmd->result = DID_OK << 16;
+ cmd->status.combined = DID_OK << 16;
else
- cmd->result = DID_ERROR << 16;
+ cmd->status.combined = DID_ERROR << 16;
done(cmd);
return 0;
}
@@ -766,7 +766,7 @@ static void stex_scsi_done(struct st_ccb *ccb)
break;
}
- cmd->result = result;
+ cmd->status.combined = result;
cmd->scsi_done(cmd);
}
An explanation of the purpose of this patch is available in the patch "scsi: Introduce the scsi_status union". Cc: Charles Chiou <charles.chiou@tw.promise.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- drivers/scsi/stex.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)