diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-05-23 19:54:56 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-06-02 23:09:39 -0400 |
commit | 149d0e489e807f1e6dc265f975a793cea11ecbea (patch) | |
tree | a0e16e90e239694ff6a13f0551dd55a07be67985 /drivers/scsi/constants.c | |
parent | d377f415dddc18b33c88dcd41cfe4fe6d9db82fb (diff) | |
download | linux-149d0e489e807f1e6dc265f975a793cea11ecbea.tar.gz linux-149d0e489e807f1e6dc265f975a793cea11ecbea.tar.bz2 linux-149d0e489e807f1e6dc265f975a793cea11ecbea.zip |
scsi: core: Introduce enums for the SAM and host status codes
Make it possible for the compiler to verify whether SAM and host
status codes are used correctly.
[mkp: resolve conflicts with Hannes' SCSI result series]
Link: https://lore.kernel.org/r/20210524025457.11299-3-bvanassche@acm.org
Cc: Hannes Reinecke <hare@suse.com>
Reviewed-by: John Garry <john.garry@huawei.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/constants.c')
-rw-r--r-- | drivers/scsi/constants.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index 41bcfed08260..340785536998 100644 --- a/drivers/scsi/constants.c +++ b/drivers/scsi/constants.c @@ -408,8 +408,8 @@ static const char * const hostbyte_table[]={ const char *scsi_hostbyte_string(int result) { + enum scsi_host_status hb = host_byte(result); const char *hb_string = NULL; - int hb = host_byte(result); if (hb < ARRAY_SIZE(hostbyte_table)) hb_string = hostbyte_table[hb]; |