@@ -4475,7 +4475,7 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd)
case REQUEST_SENSE:
ata_scsi_set_sense(dev, cmd, 0, 0, 0);
- cmd->result = (DRIVER_SENSE << 24);
+ set_driver_byte(cmd, DRIVER_SENSE);
break;
/* if we reach this, then writeback caching is disabled,
@@ -2093,7 +2093,6 @@ do { \
#define STATUS_BYTE(byte) (byte)
#define MSG_BYTE(byte) ((byte) << 8)
#define HOST_BYTE(byte) ((byte) << 16)
-#define DRIVER_BYTE(byte) ((byte) << 24)
#define ASC_STATS(shost, counter) ASC_STATS_ADD(shost, counter, 1)
#ifndef ADVANSYS_STATS
@@ -1941,7 +1941,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
memcpy(cmd->sense_buffer,
ahd_get_sense_buf(ahd, scb)
+ sense_offset, sense_size);
- cmd->result |= (DRIVER_SENSE << 24);
+ set_driver_byte(cmd, DRIVER_SENSE);
#ifdef AHD_DEBUG
if (ahd_debug & AHD_SHOW_SENSE) {
@@ -1856,7 +1856,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
if (sense_size < SCSI_SENSE_BUFFERSIZE)
memset(&cmd->sense_buffer[sense_size], 0,
SCSI_SENSE_BUFFERSIZE - sense_size);
- cmd->result |= (DRIVER_SENSE << 24);
+ set_driver_byte(cmd, DRIVER_SENSE);
#ifdef AHC_DEBUG
if (ahc_debug & AHC_SHOW_SENSE) {
int i;
@@ -1211,7 +1211,7 @@ static void arcmsr_report_sense_info(struct CommandControlBlock *ccb)
memcpy(sensebuffer, ccb->arcmsr_cdb.SenseData, sense_data_length);
sensebuffer->ErrorCode = SCSI_SENSE_CURRENT_ERRORS;
sensebuffer->Valid = 1;
- pcmd->result |= (DRIVER_SENSE << 24);
+ set_driver_byte(pcmd, DRIVER_SENSE);
}
}
@@ -3309,7 +3309,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
memcpy(cmd->scmd->sense_buffer, cmd->sense,
hdr->sense_len);
- cmd->scmd->result |= DRIVER_SENSE << 24;
+ set_driver_byte(cmd->scmd, DRIVER_SENSE);
}
break;
@@ -1795,7 +1795,7 @@ map_cmd_status(struct fusion_context *fusion,
SCSI_SENSE_BUFFERSIZE);
memcpy(scmd->sense_buffer, sense,
SCSI_SENSE_BUFFERSIZE);
- scmd->result |= DRIVER_SENSE << 24;
+ set_driver_byte(scmd, DRIVER_SENSE);
}
/*
@@ -1330,11 +1330,12 @@ static void mvumi_complete_cmd(struct mvumi_hba *mhba, struct mvumi_cmd *cmd,
if (ob_frame->rsp_flag & CL_RSP_FLAG_SENSEDATA) {
memcpy(cmd->scmd->sense_buffer, ob_frame->payload,
sizeof(struct mvumi_sense_data));
- scmd->result |= (DRIVER_SENSE << 24);
+ set_driver_byte(scmd, DRIVER_SENSE);
}
break;
default:
- scmd->result |= (DRIVER_INVALID << 24) | (DID_ABORT << 16);
+ set_driver_byte(scmd, DRIVER_INVALID);
+ scmd->result |= (DID_ABORT << 16);
break;
}
@@ -224,7 +224,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
* must have taken place. Make a note of this.
*/
if (SCSI_SENSE_VALID(cmd))
- cmd->result |= (DRIVER_SENSE << 24);
+ set_driver_byte(cmd, DRIVER_SENSE);
SCSI_LOG_MLCOMPLETE(4, sdev_printk(KERN_INFO, sdev,
"Notifying upper driver of completion "
@@ -2068,7 +2068,7 @@ void scsi_eh_flush_done_q(struct list_head *done_q)
* set, do not set DRIVER_TIMEOUT.
*/
if (!scmd->result)
- scmd->result |= (DRIVER_TIMEOUT << 24);
+ set_driver_byte(scmd, DRIVER_TIMEOUT);
SCSI_LOG_ERROR_RECOVERY(3,
scmd_printk(KERN_INFO, scmd,
"%s: flush finish cmd\n",
@@ -563,7 +563,7 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter,
btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) {
set_scsi_result(cmd, 0, DID_OK, 0, sdstat);
if (sdstat == SAM_STAT_CHECK_CONDITION && cmd->sense_buffer)
- cmd->result |= (DRIVER_SENSE << 24);
+ set_driver_byte(cmd, DRIVER_SENSE);
} else
switch (btstat) {
case BTSTAT_SUCCESS:
@@ -588,7 +588,7 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter,
case BTSTAT_LUNMISMATCH:
case BTSTAT_TAGREJECT:
case BTSTAT_BADMSG:
- cmd->result = (DRIVER_INVALID << 24);
+ set_driver_byte(cmd, DRIVER_INVALID);
/* fall through */
case BTSTAT_HAHARDWARE:
<SmPL> @@ struct scsi_cmnd *c; expression E1, E2; @@ ( - c->result = E1 << 24 | E2; + c->result = 0; + set_driver_byte(c, E1); + c->result |= E2; | - c->result |= E1 << 24 | E2; + set_driver_byte(c, E1); + c->result |= E2; | - c->result = E1 << 24; + c->result = 0; + set_driver_byte(c, E1); | - c->result |= E1 << 24; + set_driver_byte(c, E1); ) <SmPL> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> --- drivers/ata/libata-scsi.c | 2 +- drivers/scsi/advansys.c | 1 - drivers/scsi/aic7xxx/aic79xx_osm.c | 2 +- drivers/scsi/aic7xxx/aic7xxx_osm.c | 2 +- drivers/scsi/arcmsr/arcmsr_hba.c | 2 +- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 +- drivers/scsi/mvumi.c | 5 +++-- drivers/scsi/scsi.c | 2 +- drivers/scsi/scsi_error.c | 2 +- drivers/scsi/vmw_pvscsi.c | 4 ++-- 11 files changed, 13 insertions(+), 13 deletions(-)