diff options
author | Hannes Reinecke <hare@suse.de> | 2021-04-27 10:30:13 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-06-01 04:48:21 +0200 |
commit | f2b1e9c6f867ec8f929e96ba4e4010e267587448 (patch) | |
tree | 5bf630724f083e7dd2a8e82959d9bb342f0b3644 /drivers/scsi/megaraid.c | |
parent | scsi: core: Stop using DRIVER_ERROR (diff) | |
download | linux-f2b1e9c6f867ec8f929e96ba4e4010e267587448.tar.xz linux-f2b1e9c6f867ec8f929e96ba4e4010e267587448.zip |
scsi: core: Introduce scsi_build_sense()
Introduce scsi_build_sense() as a wrapper around scsi_build_sense_buffer()
to format the buffer and set the correct SCSI status.
Link: https://lore.kernel.org/r/20210427083046.31620-8-hare@suse.de
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r-- | drivers/scsi/megaraid.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 80f546976c7e..ae3f32f89381 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -1596,11 +1596,9 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) cmd->result = (DRIVER_SENSE << 24) | (DID_OK << 16) | (CHECK_CONDITION << 1); - } else { - cmd->sense_buffer[0] = 0x70; - cmd->sense_buffer[2] = ABORTED_COMMAND; - cmd->result |= (CHECK_CONDITION << 1); - } + } else + scsi_build_sense(cmd, 0, + ABORTED_COMMAND, 0, 0); } break; |