Refactor the qla2xxx 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>
---
drivers/scsi/qla2xxx/qla_isr.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 63b70d4abbf0..89c2af3fee4f 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -3263,21 +3263,24 @@ qla2x00_handle_dif_error(srb_t *sp, void *pkt)
/* check guard */
if (e_guard != a_guard) {
- scsi_build_sense(cmd, 1, ILLEGAL_REQUEST, 0x10, 0x1);
+ scsi_set_sense(cmd, 1, ILLEGAL_REQUEST,
+ LOGICAL_BLOCK_GUARD_CHECK_FAILED);
set_host_byte(cmd, DID_ABORT);
return 1;
}
/* check ref tag */
if (e_ref_tag != a_ref_tag) {
- scsi_build_sense(cmd, 1, ILLEGAL_REQUEST, 0x10, 0x3);
+ scsi_set_sense(cmd, 1, ILLEGAL_REQUEST,
+ LOGICAL_BLOCK_REFERENCE_TAG_CHECK_FAILED);
set_host_byte(cmd, DID_ABORT);
return 1;
}
/* check appl tag */
if (e_app_tag != a_app_tag) {
- scsi_build_sense(cmd, 1, ILLEGAL_REQUEST, 0x10, 0x2);
+ scsi_set_sense(cmd, 1, ILLEGAL_REQUEST,
+ LOGICAL_BLOCK_APPLICATION_TAG_CHECK_FAILED);
set_host_byte(cmd, DID_ABORT);
return 1;
}--
2.55.0