diff options
author | Hannes Reinecke <hare@suse.de> | 2021-04-27 11:30:13 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-06-01 05:48:21 +0300 |
commit | f2b1e9c6f867ec8f929e96ba4e4010e267587448 (patch) | |
tree | 5bf630724f083e7dd2a8e82959d9bb342f0b3644 /drivers/ata/libata-scsi.c | |
parent | ced202f7bd78eb6a79c441a8b217e0f3d38bccfc (diff) | |
download | linux-f2b1e9c6f867ec8f929e96ba4e4010e267587448.tar.xz |
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/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 513826eea682..61e15a2ce966 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -196,9 +196,7 @@ void ata_scsi_set_sense(struct ata_device *dev, struct scsi_cmnd *cmd, if (!cmd) return; - cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; - - scsi_build_sense_buffer(d_sense, cmd->sense_buffer, sk, asc, ascq); + scsi_build_sense(cmd, d_sense, sk, asc, ascq); } void ata_scsi_set_sense_information(struct ata_device *dev, @@ -882,8 +880,7 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc) * ATA PASS-THROUGH INFORMATION AVAILABLE * Always in descriptor format sense. */ - scsi_build_sense_buffer(1, cmd->sense_buffer, - RECOVERED_ERROR, 0, 0x1D); + scsi_build_sense(cmd, 1, RECOVERED_ERROR, 0, 0x1D); } if ((cmd->sense_buffer[0] & 0x7f) >= 0x72) { |