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/ips.c | 72 +++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 1a3c534826ba..4be97e52bbd5 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -935,7 +935,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) ips_name, ha->host_num); while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->status.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); ips_freescb(ha, scb); } @@ -945,7 +945,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) ips_name, ha->host_num); while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { - scsi_cmd->result = DID_ERROR; + scsi_cmd->status.combined = DID_ERROR; scsi_cmd->scsi_done(scsi_cmd); } @@ -964,7 +964,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) ips_name, ha->host_num); while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->status.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); ips_freescb(ha, scb); } @@ -974,7 +974,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) ips_name, ha->host_num); while ((scsi_cmd = ips_removeq_wait_head(&ha->scb_waitlist))) { - scsi_cmd->result = DID_ERROR << 16; + scsi_cmd->status.combined = DID_ERROR << 16; scsi_cmd->scsi_done(scsi_cmd); } @@ -993,7 +993,7 @@ static int __ips_eh_reset(struct scsi_cmnd *SC) DEBUG_VAR(1, "(%s%d) Failing active commands", ips_name, ha->host_num); while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { - scb->scsi_cmd->result = DID_RESET << 16; + scb->scsi_cmd->status.combined = DID_RESET << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); ips_freescb(ha, scb); } @@ -1052,13 +1052,13 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) if (ips_is_passthru(SC)) { if (ha->copp_waitlist.count == IPS_MAX_IOCTL_QUEUE) { - SC->result = DID_BUS_BUSY << 16; + SC->status.combined = DID_BUS_BUSY << 16; done(SC); return (0); } } else if (ha->scb_waitlist.count == IPS_MAX_QUEUE) { - SC->result = DID_BUS_BUSY << 16; + SC->status.combined = DID_BUS_BUSY << 16; done(SC); return (0); @@ -1075,7 +1075,7 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) /* Check for command to initiator IDs */ if ((scmd_channel(SC) > 0) && (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) { - SC->result = DID_NO_CONNECT << 16; + SC->status.combined = DID_NO_CONNECT << 16; done(SC); return (0); @@ -1092,13 +1092,13 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) if ((pt->CoppCP.cmd.reset.op_code == IPS_CMD_RESET_CHANNEL) && (pt->CoppCP.cmd.reset.adapter_flag == 1)) { if (ha->scb_activelist.count != 0) { - SC->result = DID_BUS_BUSY << 16; + SC->status.combined = DID_BUS_BUSY << 16; done(SC); return (0); } ha->ioctl_reset = 1; /* This reset request is from an IOCTL */ __ips_eh_reset(SC); - SC->result = DID_OK << 16; + SC->status.combined = DID_OK << 16; SC->scsi_done(SC); return (0); } @@ -1107,7 +1107,7 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) scratch = kmalloc(sizeof (ips_copp_wait_item_t), GFP_ATOMIC); if (!scratch) { - SC->result = DID_ERROR << 16; + SC->status.combined = DID_ERROR << 16; done(SC); return (0); @@ -1125,7 +1125,7 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) return (0); out_error: - SC->result = DID_ERROR << 16; + SC->status.combined = DID_ERROR << 16; done(SC); return (0); @@ -1610,7 +1610,7 @@ ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) &ips_num_controllers, sizeof (int)); ips_scmd_buf_write(SC, ha->ioctl_data, sizeof (ips_passthru_t) + sizeof (int)); - SC->result = DID_OK << 16; + SC->status.combined = DID_OK << 16; return (IPS_SUCCESS_IMM); @@ -1667,7 +1667,7 @@ ips_flash_copperhead(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) } pt->BasicStatus = 0x0B; pt->ExtendedStatus = 0; - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; /* IF it's OK to Use the "CD BOOT" Flash Buffer, then you can */ /* avoid allocating a huge buffer per adapter ( which can fail ). */ if (pt->CoppCP.cmd.flashfw.type == IPS_BIOS_IMAGE && @@ -1869,7 +1869,7 @@ ips_flash_firmware(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) scb->cmd.flashfw.buffer_addr = cpu_to_le32(scb->data_busaddr); if (pt->TimeOut) scb->timeout = pt->TimeOut; - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; return IPS_SUCCESS; } @@ -1971,7 +1971,7 @@ ips_usrcmd(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) } /* assume success */ - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; /* success */ return (1); @@ -2578,7 +2578,7 @@ ips_next(ips_ha_t * ha, int intr) switch (ret) { case IPS_FAILURE: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->status.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -2586,7 +2586,7 @@ ips_next(ips_ha_t * ha, int intr) break; case IPS_SUCCESS_IMM: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -2611,7 +2611,7 @@ ips_next(ips_ha_t * ha, int intr) switch (ret) { case IPS_FAILURE: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->status.combined = DID_ERROR << 16; } ips_freescb(ha, scb); @@ -2646,7 +2646,7 @@ ips_next(ips_ha_t * ha, int intr) if (intr == IPS_INTR_ON) spin_unlock(host->host_lock); /* Unlock HA after command is taken off queue */ - SC->result = DID_OK; + SC->status.combined = DID_OK; SC->host_scribble = NULL; scb->target_id = SC->device->id; @@ -2711,7 +2711,7 @@ ips_next(ips_ha_t * ha, int intr) break; case IPS_FAILURE: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->status.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -3205,7 +3205,7 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) switch (ret) { case IPS_FAILURE: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->status.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -3213,7 +3213,7 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) break; case IPS_SUCCESS_IMM: if (scb->scsi_cmd) { - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->status.combined = DID_ERROR << 16; scb->scsi_cmd->scsi_done(scb->scsi_cmd); } @@ -3366,7 +3366,7 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) } /* end switch */ } /* end switch */ - scb->scsi_cmd->result = device_error | (errcode << 16); + scb->scsi_cmd->status.combined = device_error | (errcode << 16); return (1); } @@ -3484,11 +3484,11 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) case ERASE: case WRITE_FILEMARKS: case SPACE: - scb->scsi_cmd->result = DID_ERROR << 16; + scb->scsi_cmd->status.combined = DID_ERROR << 16; break; case START_STOP: - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; break; case TEST_UNIT_READY: @@ -3499,7 +3499,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) * or we have a SCSI inquiry */ if (scb->scsi_cmd->cmnd[0] == TEST_UNIT_READY) - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; if (scb->scsi_cmd->cmnd[0] == INQUIRY) { IPS_SCSI_INQ_DATA inquiry; @@ -3531,7 +3531,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) &inquiry, sizeof (inquiry)); - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; } } else { scb->cmd.logical_info.op_code = IPS_CMD_GET_LD_INFO; @@ -3549,7 +3549,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) case REQUEST_SENSE: ips_reqsen(ha, scb); - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; break; case READ_6: @@ -3645,7 +3645,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) * we don't have to do anything * so just return */ - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; } else ret = IPS_SUCCESS; @@ -3653,7 +3653,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) case RESERVE: case RELEASE: - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; break; case MODE_SENSE: @@ -3687,7 +3687,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) case READ_DEFECT_DATA: case READ_BUFFER: case WRITE_BUFFER: - scb->scsi_cmd->result = DID_OK << 16; + scb->scsi_cmd->status.combined = DID_OK << 16; break; default: @@ -3703,7 +3703,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) sp[13] = 0x00; /* ASCQ */ device_error = 2; /* Indicate Check Condition */ - scb->scsi_cmd->result = device_error | (DID_OK << 16); + scb->scsi_cmd->status.combined = device_error | (DID_OK << 16); break; } /* end switch */ } @@ -3717,7 +3717,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) /* If we already know the Device is Not there, no need to attempt a Command */ /* This also protects an NT FailOver Controller from getting CDB's sent to it */ if (ha->conf->dev[scb->bus - 1][scb->target_id].ucState == 0) { - scb->scsi_cmd->result = DID_NO_CONNECT << 16; + scb->scsi_cmd->status.combined = DID_NO_CONNECT << 16; return (IPS_SUCCESS_IMM); } @@ -3957,14 +3957,14 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) errcode = DID_ERROR; } /* end switch */ - scb->scsi_cmd->result = errcode << 16; + scb->scsi_cmd->status.combined = errcode << 16; } else { /* bus == 0 */ /* restrict access to physical drives */ if (scb->scsi_cmd->cmnd[0] == INQUIRY) { ips_scmd_buf_read(scb->scsi_cmd, &inquiryData, sizeof (inquiryData)); if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) - scb->scsi_cmd->result = DID_TIME_OUT << 16; + scb->scsi_cmd->status.combined = DID_TIME_OUT << 16; } } /* else */ } else { /* recovered error / success */