summaryrefslogtreecommitdiff
path: root/drivers/scsi/constants.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2021-05-23 19:54:56 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2021-06-02 23:09:39 -0400
commit149d0e489e807f1e6dc265f975a793cea11ecbea (patch)
treea0e16e90e239694ff6a13f0551dd55a07be67985 /drivers/scsi/constants.c
parentd377f415dddc18b33c88dcd41cfe4fe6d9db82fb (diff)
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.c2
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];