diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 174e80fbbdaedceceeaf179135dab36b3c5679f5..bab2f665b6c25e570feba9ffbfe8d6d8d8fd7a83 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2671,25 +2671,28 @@ struct event_arg { /* * Fibre channel port/lun states. */ -#define FCS_UNCONFIGURED 1 -#define FCS_DEVICE_DEAD 2 -#define FCS_DEVICE_LOST 3 -#define FCS_ONLINE 4 +enum { + FCS_UNKNOWN, + FCS_UNCONFIGURED, + FCS_DEVICE_DEAD, + FCS_DEVICE_LOST, + FCS_ONLINE, +}; extern const char *const port_state_str[5]; -static const char * const port_dstate_str[] = { - "DELETED", - "GNN_ID", - "GNL", - "LOGIN_PEND", - "LOGIN_FAILED", - "GPDB", - "UPD_FCPORT", - "LOGIN_COMPLETE", - "ADISC", - "DELETE_PEND", - "LOGIN_AUTH_PEND", +static const char *const port_dstate_str[] = { + [DSC_DELETED] = "DELETED", + [DSC_GNN_ID] = "GNN_ID", + [DSC_GNL] = "GNL", + [DSC_LOGIN_PEND] = "LOGIN_PEND", + [DSC_LOGIN_FAILED] = "LOGIN_FAILED", + [DSC_GPDB] = "GPDB", + [DSC_UPD_FCPORT] = "UPD_FCPORT", + [DSC_LOGIN_COMPLETE] = "LOGIN_COMPLETE", + [DSC_ADISC] = "ADISC", + [DSC_DELETE_PEND] = "DELETE_PEND", + [DSC_LOGIN_AUTH_PEND] = "LOGIN_AUTH_PEND", }; /* diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index aaf6504570fdd03ce3e0164861920b75178be01a..092e4b5da65a7c05539790cf09395bd05a3f3f05 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -49,11 +49,11 @@ qla27xx_process_purex_fpin(struct scsi_qla_host *vha, struct purex_item *item) } const char *const port_state_str[] = { - "Unknown", - "UNCONFIGURED", - "DEAD", - "LOST", - "ONLINE" + [FCS_UNKNOWN] = "Unknown", + [FCS_UNCONFIGURED] = "UNCONFIGURED", + [FCS_DEVICE_DEAD] = "DEAD", + [FCS_DEVICE_LOST] = "LOST", + [FCS_ONLINE] = "ONLINE" }; static void