[077/117] pcmcia: Convert to the scsi_status union

Message ID 20210420000845.25873-78-bvanassche@acm.org
State New
Headers show
Series
  • Make better use of static type checking
Related show

Commit Message

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

Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/pcmcia/nsp_cs.c       | 18 ++++++++++--------
 drivers/scsi/pcmcia/sym53c500_cs.c | 12 ++++++------
 2 files changed, 16 insertions(+), 14 deletions(-)

Patch

diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 5d5f50d6a02d..8c3642b6a02e 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -202,7 +202,7 @@  static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt,
 
 	if (data->CurrentSC != NULL) {
 		nsp_msg(KERN_DEBUG, "CurrentSC!=NULL this can't be happen");
-		SCpnt->result   = DID_BAD_TARGET << 16;
+		SCpnt->status.combined = DID_BAD_TARGET << 16;
 		nsp_scsi_done(SCpnt);
 		return 0;
 	}
@@ -249,7 +249,7 @@  static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt,
 
 	if (nsphw_start_selection(SCpnt) == FALSE) {
 		nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "selection fail");
-		SCpnt->result   = DID_BUS_BUSY << 16;
+		SCpnt->status.combined = DID_BUS_BUSY << 16;
 		nsp_scsi_done(SCpnt);
 		return 0;
 	}
@@ -1034,7 +1034,8 @@  static irqreturn_t nspintr(int irq, void *dev_id)
 
 		if(data->CurrentSC != NULL) {
 			tmpSC = data->CurrentSC;
-			tmpSC->result  = (DID_RESET                   << 16) |
+			tmpSC->status.combined =
+					 (DID_RESET                   << 16) |
 				         ((tmpSC->SCp.Message & 0xff) <<  8) |
 				         ((tmpSC->SCp.Status  & 0xff) <<  0);
 			nsp_scsi_done(tmpSC);
@@ -1083,7 +1084,7 @@  static irqreturn_t nspintr(int irq, void *dev_id)
 				data->SelectionTimeOut = 0;
 				nsp_index_write(base, SCSIBUSCTRL, 0);
 
-				tmpSC->result   = DID_TIME_OUT << 16;
+				tmpSC->status.combined = DID_TIME_OUT << 16;
 				nsp_scsi_done(tmpSC);
 
 				return IRQ_HANDLED;
@@ -1107,7 +1108,7 @@  static irqreturn_t nspintr(int irq, void *dev_id)
 		// *sync_neg = SYNC_NOT_YET;
 		if ((phase & BUSMON_PHASE_MASK) != BUSPHASE_MESSAGE_IN) {
 
-			tmpSC->result	= DID_ABORT << 16;
+			tmpSC->status.combined = DID_ABORT << 16;
 			nsp_scsi_done(tmpSC);
 			return IRQ_HANDLED;
 		}
@@ -1133,10 +1134,11 @@  static irqreturn_t nspintr(int irq, void *dev_id)
 
 		/* all command complete and return status */
 		if (tmpSC->SCp.Message == COMMAND_COMPLETE) {
-			tmpSC->result = (DID_OK		             << 16) |
+			tmpSC->status.combined =
+					(DID_OK		             << 16) |
 					((tmpSC->SCp.Message & 0xff) <<  8) |
 					((tmpSC->SCp.Status  & 0xff) <<  0);
-			nsp_dbg(NSP_DEBUG_INTR, "command complete result=0x%x", tmpSC->result);
+			nsp_dbg(NSP_DEBUG_INTR, "command complete result=0x%x", tmpSC->status.combined);
 			nsp_scsi_done(tmpSC);
 
 			return IRQ_HANDLED;
@@ -1151,7 +1153,7 @@  static irqreturn_t nspintr(int irq, void *dev_id)
 		nsp_msg(KERN_DEBUG, "unexpected bus free. irq_status=0x%x, phase=0x%x, irq_phase=0x%x", irq_status, phase, irq_phase);
 
 		*sync_neg       = SYNC_NG;
-		tmpSC->result   = DID_ERROR << 16;
+		tmpSC->status.combined = DID_ERROR << 16;
 		nsp_scsi_done(tmpSC);
 		return IRQ_HANDLED;
 	}
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index a366ff1a3959..2f115b51669a 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -373,34 +373,34 @@  SYM53C500_intr(int irq, void *dev_id)
 
 	if (int_reg & 0x80) {	/* SCSI reset intr */
 		DEB(printk("SYM53C500: reset intr received\n"));
-		curSC->result = DID_RESET << 16;
+		curSC->status.combined = DID_RESET << 16;
 		goto idle_out;
 	}
 
 	if (pio_status & 0x80) {
 		printk("SYM53C500: Warning: PIO error!\n");
-		curSC->result = DID_ERROR << 16;
+		curSC->status.combined = DID_ERROR << 16;
 		goto idle_out;
 	}
 
 	if (status & 0x20) {		/* Parity error */
 		printk("SYM53C500: Warning: parity error!\n");
-		curSC->result = DID_PARITY << 16;
+		curSC->status.combined = DID_PARITY << 16;
 		goto idle_out;
 	}
 
 	if (status & 0x40) {		/* Gross error */
 		printk("SYM53C500: Warning: gross error!\n");
-		curSC->result = DID_ERROR << 16;
+		curSC->status.combined = DID_ERROR << 16;
 		goto idle_out;
 	}
 
 	if (int_reg & 0x20) {		/* Disconnect */
 		DEB(printk("SYM53C500: disconnect intr received\n"));
 		if (curSC->SCp.phase != message_in) {	/* Unexpected disconnect */
-			curSC->result = DID_NO_CONNECT << 16;
+			curSC->status.combined = DID_NO_CONNECT << 16;
 		} else {	/* Command complete, return status and message */
-			curSC->result = (curSC->SCp.Status & 0xff)
+			curSC->status.combined = (curSC->SCp.Status & 0xff)
 			    | ((curSC->SCp.Message & 0xff) << 8) | (DID_OK << 16);
 		}
 		goto idle_out;