diff mbox series

[058/117] imm: Convert to the scsi_status union

Message ID 20210420000845.25873-59-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".

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/imm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index 862d35a098cf..a425127aa35f 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -158,7 +158,7 @@  imm_fail(imm_struct *dev, int error_code)
 {
 	/* If we fail a device then we trash status / message bytes */
 	if (dev->cur_cmd) {
-		dev->cur_cmd->result = error_code << 16;
+		dev->cur_cmd->status.combined = error_code << 16;
 		dev->failed = 1;
 	}
 }
@@ -729,7 +729,7 @@  static void imm_interrupt(struct work_struct *work)
 	}
 	/* Command must of completed hence it is safe to let go... */
 #if IMM_DEBUG > 0
-	switch ((cmd->result >> 16) & 0xff) {
+	switch ((cmd->status.combined >> 16) & 0xff) {
 	case DID_OK:
 		break;
 	case DID_NO_CONNECT:
@@ -758,7 +758,7 @@  static void imm_interrupt(struct work_struct *work)
 		break;
 	default:
 		printk("imm: bad return code (%02x)\n",
-		       (cmd->result >> 16) & 0xff);
+		       (cmd->status.combined >> 16) & 0xff);
 	}
 #endif
 
@@ -894,7 +894,7 @@  static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
 			/* Check for optional message byte */
 			if (imm_wait(dev) == (unsigned char) 0xb8)
 				imm_in(dev, &h, 1);
-			cmd->result = (DID_OK << 16) | (l & STATUS_MASK);
+			cmd->status.combined = (DID_OK << 16) | (l & STATUS_MASK);
 		}
 		if ((dev->mode == IMM_NIBBLE) || (dev->mode == IMM_PS2)) {
 			w_ctr(ppb, 0x4);
@@ -923,7 +923,7 @@  static int imm_queuecommand_lck(struct scsi_cmnd *cmd,
 	dev->jstart = jiffies;
 	dev->cur_cmd = cmd;
 	cmd->scsi_done = done;
-	cmd->result = DID_ERROR << 16;	/* default return code */
+	cmd->status.combined = DID_ERROR << 16;	/* default return code */
 	cmd->SCp.phase = 0;	/* bus free */
 
 	schedule_delayed_work(&dev->imm_tq, 0);