summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-04-27 10:30:15 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2021-06-01 04:48:21 +0200
commit464a00c9e0ad45e3f42ff6ea705491a356df818e (patch)
tree2e5cbde03f97f84da0913242a8a3baf4f4c1fa46 /drivers/scsi/megaraid.c
parentscsi: core: Introduce scsi_status_is_check_condition() (diff)
downloadlinux-464a00c9e0ad45e3f42ff6ea705491a356df818e.tar.xz
linux-464a00c9e0ad45e3f42ff6ea705491a356df818e.zip
scsi: core: Kill DRIVER_SENSE
Replace the check for DRIVER_SENSE with a check for scsi_status_is_check_condition(). Audit all callsites to ensure the SAM status is set correctly. For backwards compability move the DRIVER_SENSE definition to sg.h, and update sg, bsg, and scsi_ioctl to set the DRIVER_SENSE driver_status whenever SAM_STAT_CHECK_CONDITION is present. [mkp: fix zeroday srp warning] Link: https://lore.kernel.org/r/20210427083046.31620-10-hare@suse.de Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> fix
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r--drivers/scsi/megaraid.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index ae3f32f89381..1880471c632a 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -1583,9 +1583,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status)
memcpy(cmd->sense_buffer, pthru->reqsensearea,
14);
- cmd->result = (DRIVER_SENSE << 24) |
- (DID_OK << 16) |
- (CHECK_CONDITION << 1);
+ cmd->result = SAM_STAT_CHECK_CONDITION;
}
else {
if (mbox->m_out.cmd == MEGA_MBOXCMD_EXTPTHRU) {
@@ -1593,9 +1591,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status)
memcpy(cmd->sense_buffer,
epthru->reqsensearea, 14);
- cmd->result = (DRIVER_SENSE << 24) |
- (DID_OK << 16) |
- (CHECK_CONDITION << 1);
+ cmd->result = SAM_STAT_CHECK_CONDITION;
} else
scsi_build_sense(cmd, 0,
ABORTED_COMMAND, 0, 0);