scsi: core: Introduce enum scsi_disposition
authorBart Van Assche <bvanassche@acm.org>
Thu, 15 Apr 2021 22:08:11 +0000 (15:08 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 16 Apr 2021 02:44:40 +0000 (22:44 -0400)
commitb8e162f9e7e2da6e823a4984d6aa0523e278babf
treefcc0568d9fd33460ed837277c91c72858fe3a408
parent280e91b026653af77296b5feb54f16d85973b104
scsi: core: Introduce enum scsi_disposition

Improve readability of the code in the SCSI core by introducing an
enumeration type for the values used internally that decide how to continue
processing a SCSI command. The eh_*_handler return values have not been
changed because that would involve modifying all SCSI drivers.

The output of the following command has been inspected to verify that no
out-of-range values are assigned to a variable of type enum
scsi_disposition:

KCFLAGS=-Wassign-enum make CC=clang W=1 drivers/scsi/

Link: https://lore.kernel.org/r/20210415220826.29438-6-bvanassche@acm.org
Cc: Christoph Hellwig <hch@lst.de>
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ata/libata-eh.c
drivers/scsi/device_handler/scsi_dh_alua.c
drivers/scsi/device_handler/scsi_dh_emc.c
drivers/scsi/device_handler/scsi_dh_rdac.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_priv.h
include/scsi/scsi.h
include/scsi/scsi_dh.h
include/scsi/scsi_eh.h