Refactor the PS3 DVD driver to use scsi_set_sense() and replace all
hard-coded additional sense codes and additional sense code qualifiers
with the enum values defined in include/scsi/scsi_sense.h. This helps with
code clarity as the sense codes being processed are easier to test and
self-documented.
No functional change intended.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <redacted>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
---
drivers/scsi/ps3rom.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index a9c727d22931..c63c581b493c 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -233,7 +233,8 @@ static enum scsi_qc_status ps3rom_queuecommand_lck(struct scsi_cmnd *cmd)
}
if (res) {
- scsi_build_sense(cmd, 0, ILLEGAL_REQUEST, 0, 0);
+ scsi_set_sense(cmd, 0, ILLEGAL_REQUEST,
+ NO_ADDITIONAL_SENSE_INFORMATION);
cmd->result = res;
priv->curr_cmd = NULL;
scsi_done(cmd);@@ -316,7 +317,7 @@ static irqreturn_t ps3rom_interrupt(int irq, void *data)
goto done;
}
- scsi_build_sense(cmd, 0, sense_key, asc, ascq);
+ scsi_set_sense(cmd, 0, sense_key, scsi_sense_code(asc, ascq));
done:
priv->curr_cmd = NULL;
--
2.55.0