Refactor the SCSI core code to use the 16-bits sense_code field of
struct scsi_sense_hdr and struct scsi_failure 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, with the exception of a correction of the
array any_sense_failure_defs in scsi_lib_test_any_sense() which
erroenously sets result to SCMD_FAILURE_RESULT_ANY instead of
SAM_STAT_CHECK_CONDITION and does not sets sense_key to
SCMD_FAILURE_SENSE_KEY_ANY.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260908090308.1085097-1-dlemoal@kernel.org?part=7