diff mbox series

[056/117] ibmvscsi: Convert to the scsi_status union

Message ID 20210420000845.25873-57-bvanassche@acm.org
State New
Headers show
Series Make better use of static type checking | expand

Commit Message

Bart Van Assche April 20, 2021, 12:07 a.m. UTC
An explanation of the purpose of this patch is available in the patch
"scsi: Introduce the scsi_status union".

Cc: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ibmvscsi/ibmvscsi.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index f33f56680c59..1a02dc411f0d 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -793,7 +793,7 @@  static void purge_requests(struct ibmvscsi_host_data *hostdata, int error_code)
 
 		spin_unlock_irqrestore(hostdata->host->host_lock, flags);
 		if (evt->cmnd) {
-			evt->cmnd->result = (error_code << 16);
+			evt->cmnd->status.combined = (error_code << 16);
 			unmap_cmd_data(&evt->iu.srp.cmd, evt,
 				       evt->hostdata->dev);
 			if (evt->cmnd_done)
@@ -976,7 +976,7 @@  static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
 	unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);
 
 	if (evt_struct->cmnd != NULL) {
-		evt_struct->cmnd->result = DID_ERROR << 16;
+		evt_struct->cmnd->status.combined = DID_ERROR << 16;
 		evt_struct->cmnd_done(evt_struct->cmnd);
 	} else if (evt_struct->done)
 		evt_struct->done(evt_struct);
@@ -1004,8 +1004,8 @@  static void handle_cmd_rsp(struct srp_event_struct *evt_struct)
 	}
 	
 	if (cmnd) {
-		cmnd->result |= rsp->status;
-		if (((cmnd->result >> 1) & 0x1f) == CHECK_CONDITION)
+		cmnd->status.combined |= rsp->status;
+		if (((cmnd->status.combined >> 1) & 0x1f) == CHECK_CONDITION)
 			memcpy(cmnd->sense_buffer,
 			       rsp->data,
 			       be32_to_cpu(rsp->sense_data_len));
@@ -1049,7 +1049,7 @@  static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd,
 	u16 lun = lun_from_dev(cmnd->device);
 	u8 out_fmt, in_fmt;
 
-	cmnd->result = (DID_OK << 16);
+	cmnd->status.combined = (DID_OK << 16);
 	evt_struct = get_event_struct(&hostdata->pool);
 	if (!evt_struct)
 		return SCSI_MLQUEUE_HOST_BUSY;
@@ -1608,7 +1608,7 @@  static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
 	sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%llx\n",
 		    tsk_mgmt->task_tag);
 
-	cmd->result = (DID_ABORT << 16);
+	cmd->status.combined = (DID_ABORT << 16);
 	list_del(&found_evt->list);
 	unmap_cmd_data(&found_evt->iu.srp.cmd, found_evt,
 		       found_evt->hostdata->dev);
@@ -1713,7 +1713,7 @@  static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
 	list_for_each_entry_safe(tmp_evt, pos, &hostdata->sent, list) {
 		if ((tmp_evt->cmnd) && (tmp_evt->cmnd->device == cmd->device)) {
 			if (tmp_evt->cmnd)
-				tmp_evt->cmnd->result = (DID_RESET << 16);
+				tmp_evt->cmnd->status.combined = (DID_RESET << 16);
 			list_del(&tmp_evt->list);
 			unmap_cmd_data(&tmp_evt->iu.srp.cmd, tmp_evt,
 				       tmp_evt->hostdata->dev);
@@ -1842,7 +1842,7 @@  static void ibmvscsi_handle_crq(struct viosrp_crq *crq,
 	del_timer(&evt_struct->timer);
 
 	if ((crq->status != VIOSRP_OK && crq->status != VIOSRP_OK2) && evt_struct->cmnd)
-		evt_struct->cmnd->result = DID_ERROR << 16;
+		evt_struct->cmnd->status.combined = DID_ERROR << 16;
 	if (evt_struct->done)
 		evt_struct->done(evt_struct);
 	else